Skip to content

Instantly share code, notes, and snippets.

@amirilovic
amirilovic / take-memory-snapshot.ts
Created July 15, 2024 20:46
A script that takes a heap snapshot from a nodejs process in debug mode
const { exec, spawn } = require("child_process");
const fs = require("fs");
const { promisify } = require("util");
import { WebSocket } from "ws";
async function getWebSocketDebuggerUrl() {
const res = await fetch("http://localhost:9229/json");
const data = await res.json();
return data[0].webSocketDebuggerUrl;
}
<script>
var module = WebAssembly.instantiateStreaming(fetch("linked_list.wasm"), {});
</script>
@da-tubi
da-tubi / ElvishScriptingBasics.md
Last active August 22, 2023 08:00
Elvish Scripting Basics

Elvish Scripting Basics

Assignment and Substitution

var a = 375
set a = 376

var hello = $a

Variables

@steve981cr
steve981cr / How-to-Release-an-Electron-App-on-the-Microsoft-Store.md
Last active April 14, 2025 12:11
Step by step instructions on how to release an Electron app on the Microsoft Store. Uses Electron-builder to package the app.
@steve981cr
steve981cr / How-to-Release-an-Electron-App-on-the-Mac-App-Store.md
Last active April 29, 2025 17:37
Step by step instructions on how to release an Electron app on the Mac App Store. Uses Electron-builder to package the app.
@ttesmer
ttesmer / AD.hs
Last active October 29, 2024 15:35
Automatic Differentiation in 38 lines of Haskell using Operator Overloading and Dual Numbers. Inspired by conal.net/papers/beautiful-differentiation
{-# LANGUAGE TypeSynonymInstances #-}
data Dual d = D Float d deriving Show
type Float' = Float
diff :: (Dual Float' -> Dual Float') -> Float -> Float'
diff f x = y'
where D y y' = f (D x 1)
class VectorSpace v where
zero :: v
// PS. Tailwind classes used for wrapper.
import { FC, useEffect, useState } from 'react'
import { FieldContainer } from '@keystone-ui/fields'
import { Field } from '@keystone-6/fields-document/views'
enum EditorState {
Loading,
Ready,
}
@wphicks
wphicks / Fraud_Detection_Example.ipynb
Last active January 28, 2023 12:44
Notebook example for fraud detection with the Triton FIL Backend
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natanlao
natanlao / syncthing-photo-sync.md
Last active February 23, 2025 18:47
Syncing iPhone photos with Syncthing

For those who prefer to avoid solutions like iCloud Photos and Dropbox for backing up photos, you can sync your iPhone photos with Syncthing. To do this, you'll need two things:

  • Möbius Sync is, to my knowledge, the only actively-maintained Syncthing client for iOS. It's free to sync up to 20 MB, and only $4.99 (one-time) to remove that limit.

  • PhotoSync is a nifty iOS app for syncing photos to a number of different destinations. It's free for low-quality