Skip to content

Instantly share code, notes, and snippets.

View Vehmloewff's full-sized avatar
🤦‍♂️
Efficiency begot effectiveness and the daughter devoured the mother

Elijah Mooring Vehmloewff

🤦‍♂️
Efficiency begot effectiveness and the daughter devoured the mother
View GitHub Profile
@Vehmloewff
Vehmloewff / .prettierrc
Last active September 1, 2020 19:54
My go-to prettier configuration
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"printWidth": 140,
"proseWrap": "preserve",
"requirePragma": false,
"semi": false,
import { createStreaming } from "https://dprint.dev/formatter/v2.ts";
const globalConfig = {
indentWidth: 2,
lineWidth: 80,
};
console.log("before createStreaming")
const tsFormatter = await createStreaming(

Some helper functions that can come in handy day to day.

export function makeEncryptor(key: string) {
const textToChars = (text: string) => text.split('').map(c => c.charCodeAt(0))
const byteHex = (n: number) => ('0' + Number(n).toString(16)).substr(-2)
const applyKeyToChar = (code: number) => textToChars(key).reduce((a, b) => a ^ b, code)
function decrypt(encoded: string) {
return (encoded.match(/.{1,2}/g) || [])
.map(hex => parseInt(hex, 16))
.map(applyKeyToChar)
.map(charCode => String.fromCharCode(charCode))
@Vehmloewff
Vehmloewff / 1.ts
Last active July 17, 2021 00:18
Deno dynamic import bug
import './2.ts'
@Vehmloewff
Vehmloewff / errors-disappear.ts
Last active November 24, 2021 01:25
Errors thrown inside http.serve disappear
import { serve } from 'https://deno.land/[email protected]/http/mod.ts'
const listener = Deno.listen({ port: 3000 })
await serve(listener, () => {
console.log('before throw')
throw new Error('whoa! this does not print')
console.log('after throw')
return new Response('hello world')
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>MyApplication</string>
<key>CFBundleExecutable</key>
<string>MyApplication</string>
<key>CFBundleIconFile</key>
<string>MyApplication.icns</string>
events {
}
http {
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
root /usr/share/nginx/html;
@Vehmloewff
Vehmloewff / appealing.tsx
Created November 30, 2022 03:30
An appealing idea for a syncjs-like framework
export function HomePage() {
const { setTemplate, update } = createPage()
const title = 'Example'
const heading = 'Simple Counter'
let clicked = 0
function increment() {
clicked++
update('#message')
brew install SergioBenitez/osxct/x86_64-unknown-linux-gnu
DEB_NAME=libssl-dev_1.1.1n-0+deb10u3_amd64.deb
OPENSSL_DIR="$HOME/.cache/temp/libssl_dev"
mkdir -p $OPENSSL_DIR/include
cd $OPENSSL_DIR
curl -O http://ftp.us.debian.org/debian/pool/main/o/openssl/$DEB_NAME
ar p $DEB_NAME data.tar.xz | tar xvf -
mv usr/include/openssl/* usr/include/x86_64-linux-gnu/openssl/