Skip to content

Instantly share code, notes, and snippets.

View Heliodex's full-sized avatar
📉
Programstinating

Lewin Kelly Heliodex

📉
Programstinating
View GitHub Profile
@TrillCyborg
TrillCyborg / mastodon-docker-setup.md
Last active April 16, 2025 03:16
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/live directory
git clone https://github.com/tootsuite/mastodon.git live
# Change directory to ~/live

cd ~/live

Boolean() or !! (double bang, double negation)?

What's the best way to answer the question "true or false?" in JavaScript

JavaScript does not bother you too much with types (at first), which is both a blessing and a cure. But we all know the Boolean type. Boolean variables can either be true or false. Yes or no.

Every value in JavaScript can be translated into a boolean, true or false. Values that translate to true are truthy, values that translate to false are falsy. Simple.

This is about two ways to make that translation.

@belisarius222
belisarius222 / ford-fusion-writeup.md
Last active July 16, 2024 10:56
ford fusion writeup

Ford Fusion

Overview and Rationale

Ford Fusion was an overhaul of Urbit's over-the-air upgrade process and a rewrite of its build system. The new update system corrects a few long-standing bugs with the previous one, and the new build system is simpler, smaller (by around 5,000 lines), and easier to manage.

Since deployment of Ford Fusion to the livenet in late June, over-the-air updates (OTAs) have been much smoother. Before Ford Fusion, it was common for an OTA to take several hours, use too much memory, and leave ships in inconsistent states. After Ford Fusion, multiple OTAs have been pushed out, including kernelspace changes, and most users didn't even notice.

Urbit has always been able to update itself OTA, but this process has often been rocky. Updating an operating system kernel on-the-fly is a difficult problem in general, like performing heart replacement surgery on yourself while running a marathon. Code that allows Linux to update its kernel in this way became a startup called Ksplice, won

const toBoolean = (context: any, flags: string[]) => {
for (const flag of flags) {
const propValue = context[flag];
const propType = typeof propValue;
if ('boolean' === propType) {
context[flag] = propValue;
}
const fs = require('fs')
const Arweave = require('arweave/node')
const argv = require('yargs').argv
const arweave = Arweave.init({
host: argv.arweaveHost ? argv.arweaveHost : 'arweave.net',
port: argv.arweavePort ? argv.arweavePort : 443,
protocol: argv.arweaveProtocol ? argv.arweaveProtocol : 'https'
})
@spr2-dev
spr2-dev / pattern_matching.md
Last active January 22, 2025 12:15
A quick beginner guide on Lua pattern matching

Lua Pattern Matching Cheat Sheet

Table Of Contents

  1. What's a pattern ?
  2. Positional characters
  3. Common matching characters
  4. Ranges, character sets and logic
  5. Quantifiers
  6. Capture groups
  7. Examples
@botter-nidnul
botter-nidnul / steps-to-urbit-on-docker-desktop-for-windows.md
Last active April 22, 2025 10:37
Steps to Urbit on Docker Desktop for Windows

Why Docker Desktop?

  • It can start urbit automatically in the background each time you login to windows
  • Has a gui to turn urbit on/off if you don't want it running all the time
  • Sets up port forwarding to your host device's ip, which plain wsl makes difficult. So you can access landscape from other devices on your lan, or forward ports to your router to get external access
  • Automatic updates to the urbit binary

See https://subject.network/posts/urbit-windows-docker/ for an enhanced take on this guide, with screenshots and more.

How to Install Docker

@Validark
Validark / aho-corasick.lua
Created July 18, 2021 12:31
A clean implementation of the aho-corasick algorithm taking full advantage of Lua's __index metamethod.
-- We can re-use metatables where possible
local lookupCache = {
__index = function(self, i)
local v = { __index = i }
self[i] = v
return v
end
}
local function use_aho_corasick(automaton, str)
@Mullets-Gavin
Mullets-Gavin / GetProperties.lua
Last active September 1, 2023 21:49
Get all the properties on an instance
local Cached = {}
local Properties = {
"AttachmentForward",
"AttachmentPoint",
"AttachmentPos",
"AttachmentRight",
"AttachmentUp",
"AlignType",
"MaxAngularVelocity",
"MaxTorque",
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/
//Converting colors to proper format
function normalizeColor(hexCode) {