Skip to content

Instantly share code, notes, and snippets.

@aphyr
aphyr / minikanren.pl
Created October 12, 2020 22:10
Minikanren in Lisp in Prolog
:- use_module(library(pairs)).
:- use_module(library(reif)).
not_in_list(K, L) :-
if_((L = []),
true,
([X | More] = L,
dif(K, X),
not_in_list(K, More))).
@tigt
tigt / git-branch-to-favicon.js
Created March 18, 2020 21:10
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
const { execSync } = require('child_process')
const { createHash } = require('crypto')
const invertColor = require('invert-color')
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
const hash = createHash('sha256')
hash.update(branchName)
const color = '#' + hash.digest().toString('hex').substring(0, 6)
const invertedColor = invertColor(color, true)

Make GMail Great Again!

This document isn't very long. Please read it from start to finish before you try this so you don't break yer shit. Thaaaannnnnk Youuuuuu.

Prerequisites

This all assumes you're Chrome [1]. I'm using Brave Browser [2], a privacy-focused Chrome fork, and it works well. I wouldn't be surprised if other Chrome forks work as well.

Theme

@victoriachuang
victoriachuang / lead-developer-austin-2018.md
Created December 7, 2018 03:07
Lead Developer Austin 2018 talks

Navigating Team Friction

Lara Hogan, Co-founder of Wherewithall

  • Teams go through Tuckman's Stages of Group Development

    • Forming: New state; team will have roughly-planned goals and objectives
    • Storming: Friction arises as team members start to learn how to work together (this is a normal and necessary part of forming a group)
    • Norming: Members start to resolve differences
    • Performing: Flow state; members start to become productive
    • A team can restart this process when there is new management, a new team structure and/or new team members
  • Friction is normal in early stages, but can act as a distraction and a team needs to resolve differences in order to move projects forward

@shortjared
shortjared / list.txt
Last active November 18, 2024 22:51
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@atinux
atinux / async-foreach.js
Last active August 30, 2024 13:03
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@gravitylow
gravitylow / codesign_gdb.md
Last active October 23, 2024 09:17 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@marslin1220
marslin1220 / RequestPlayground.swift
Last active September 4, 2024 13:52
How to create a HTTP GET request on Swift Playground
import Foundation
import PlaygroundSupport
URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
PlaygroundPage.current.needsIndefiniteExecution = true
// Refer to the example: https://grokswift.com/simple-rest-with-swift/
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todo/1"
guard let url = URL(string: todoEndpoint) else {
print("Error: cannot create URL")
@autocorr
autocorr / tmoji
Last active September 18, 2023 12:29
A python script to send parse emoji keywords into unicode and send to tmux
#!/usr/bin/env python3
import argparse
import difflib
import subprocess
EMOJI_UNICODE = {
'+1': '\U0001F44D',
'-1': '\U0001F44E',