Show more

Moment.js has been my go-to JavaScript library for all things horological but it seems that it might be time to say goodbye 😢

momentjs.com/docs/#/-project-s

How normal are you?

Find out with this beautifully-executed and scary online experience:

hownormalami.eu/

Show thread

Today I learned that in Node.js (and in quite a few browsers), if you want to time something, you can do:

console.time('something')
// do something
console.timeLog('something')

// Output (e.g.)
// some thing: 6975.892ms

By the way, may I please take a moment to wax lyrical about rsync? I mean, seriously… hot append-only newline-delimited transaction log, being written to every 5ms, and that baby just transfers it over, uncorrupted, like a champ, every time.

*removes hat*

So, imagine this: you’re working on a site that stores some data server side. You’re testing it locally and you’ve initialised the database with some data. You want to push not just the latest site changes but the data too… you do:

site push --with-database

Your site is deployed along with the local data and is live with that data.

Later, your site is live and being used. You want to pull the live database down… you do:

site pull --just-database

Coming soon to Site.js ;)

I sure love the new cookie pop up on GitHub that appears every fucking time now in private browsing mode, don’t you? Thanks, Microsoft!

Someone made something awesome and powerful and I can’t wait to share it with you this afternoon :)

Anyone know why the V8 JavaScript engine fires two set operations internally during an array push()?

e.g., a = []; a.push('hello');

1. set a[0] = 'hello'
2. set a.length = 1

It seems odd given that array length is already 1 by the time of the second call. (If you do a[0] = 'hello' directly, you do not get the additional set attempt.)

Bug? Feature? Manual set required due to some internal optimisation with push()?

omfg, the window tiling stacking feature in the latest Pop!_OS is awesome! :)

Our quick scan on ethical digital tools:
agooodfoundation.org/in-search

In English and soon in Spanish

#SurveillanceCapitalism
from a social design perspective

Thanks @aral for the inspiration!

So I’m integrating JSDB¹ into Site.js² and just made a persistent version of the ephemeral WebSocket chat example³.

Here’s ALL the code I had to add on the server (chat.js⁴):

if (!db.messages) {
db.messages = []
}

client.send(JSON.stringify(db.messages))

// In message handler:

// Persist message
db.messages.push(message)

THAT’S IT! Can’t wait to release this ;)
___
1: github.com/small-tech/jsdb
2: sitejs.org
3: github.com/small-tech/site.js/
4: github.com/small-tech/site.js/

Business model: Hi, I’m a poison apple.

UX team: Right, let’s dip this baby in sweet candy and shove a stick into it.

Business model: I’m still a poison apple.

UX team: Yeah, but now they can’t taste the poison.

Now I know what you’re thinking: “But, they’re not going to fill all the cells now are they? And they ran out of rows.” OK, wiseass, so there are 1,048,576 rows and that would mean £11,444 per row.

Also, what are you, a communist?

Show thread

Given there are 17,179,869,184 cells in an Excel spreadsheet, the ₤12B the UK government paid for Test and Trace comes out to just £0.70 per cell.

What a bargain!

mirror.co.uk/news/politics/160

That feel when you’re making something and you know that regardless of what precautions you take some dickhead somewhere is going to use it for evil.

One of the things I love most about Linux is how much having to turn off Natural Scrolling and turn it back on again after every suspend is teaching me about computers.

Making good progress on JavaScript Database (JSDB):

- New syntax + two important safety checks to avoid data corruption
- A bunch of new documentation

What’s JSDB? e.g.,

JSDB = require('@small-tech/jsdb')
db = JSDB.open('db')
db.people = [
{name: 'Aral', hair: 'short'},
{name: 'Laura', hair: 'long'}
]
db.people.where('hair').is('long').get()

Returns: [{name: 'Laura', hair: 'long'}]

Still a work-in-progress but feel free to take a peek and play ;)

github.com/small-tech/jsdb/

Show more
Aral’s Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!