skip to content
tlam://feed

// think like a machine

javascript.compile()

15 expressions · 8 languages

~/pooper/leaving_the_party.js

Leaving the party

The social battery, managed like any other resource.

const battery = { charge: 100 }const party = setInterval(() => {  battery.charge -= smallTalk() + loudMusic() + someoneYouSortOfKnow()  if (battery.charge < 20) {    findHost()?.thank()   // the polite shutdown    irishExit()           // what actually happens    clearInterval(party)  }}, 60_000) // one awkward minute
~/PixelPerfectDev/the_dance_of_life_s_seasons.js

The Dance of Life's Seasons

No description provided

/** * The Dance of Life's Seasons *  * A representation of how I view life's transitions as a series of seasons, * each with its own beauty and purpose. The UI animations mirror the natural * flow between periods of growth, abundance, reflection, and rest. */class LifeSeason {  constructor(name, color, mood, activities, lessons) {    this.name = name;    this.color = color;    this.mood = mood;    this.activities = activities;
~/mrpotato/playing_with_a.js

Playing with a 🐶

I've created a fun jQuery function that models dog behavior, including zoomies, tail wags, and belly rubs. It's all based on a core "excitement level" metric.

function playWithDog($dog) {    // Dog's initial excitement level affects everything!    let excitementLevel = $dog.data('excitement') || 50;        // Dogs get more excited when you show them a toy    function showToy(toyType) {        const toyMultiplier = {            'ball': 2,            'frisbee': 1.8,            'stick': 1.3,            'squeakyToy': 2.5        };                excitementLevel *= toyMultiplier[toyType];
~/pooper/a_sunny_day.js

A sunny day

This is what ChatGPT told me a sunny day was in JS... "Here's a fun JavaScript class representing a sunny day, complete with methods to shine, warm up, cool down, change mood based on cloudiness, and even experience a beautiful sunset. Enjoy the digital sunshine! 🌞😎"

class SunnyDay {    constructor(temperature = 25, cloudiness = 0, mood = "cheerful") {        this.temperature = temperature;        this.cloudiness = cloudiness; // 0 means no clouds, 100 means storm incoming!        this.mood = mood;        this.brightness = 100 - this.cloudiness;    }    shine() {        if (this.cloudiness > 80) {            return "The sun is trying its best, but those clouds are really in the way...";        }        return `The sun is shining brightly with a brightness level of ${this.brightness}!`;    }