Skip to content

Instantly share code, notes, and snippets.

@DaneWeber
DaneWeber / MacOS_Catalina_ISO.sh
Last active March 14, 2024 23:01
Create a MacOS Catalina install ISO
# Download the installer for MacOS Catalina
softwareupdate --fetch-full-installer --full-installer-version 10.15.7
# Create a directory for the VM installer
cd ~/
mkdir VMs
cd VMs
mkdir installers
cd installers
@tgwizard
tgwizard / vcl_deliver.vcl
Last active June 8, 2019 17:31
Fastly VCL config for A/B tests
sub vcl_deliver {
# ----- snip -----
# Set a cookie with the experiment group sequence, if the client didn't
# already have the cookie and provided it in the request, and if the origin
# hasn't already set it. Use `setcookie.get_value_by_name` to handle the
# cases when the backend sets multiple cookies.
# Only do this on the edge nodes, not the origin shield, otherwise the edge
# nodes will see a response with a `Set-Cookie` header and not cache it.
(Chapters marked with * are already written. This gets reorganized constantly
and 10 or so written chapters that I'm on the fence about aren't listed.)
Programmer Epistemology
* Dispersed Cost vs. Reduced Cost
* Verificationist Fallacy
* Mistake Metastasis
The Overton Window
Epicycles All The Way Down
The Hyperspace Gates Were Just There
@allgress
allgress / reagent_datascript.cljs
Last active June 4, 2025 13:03
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@coreyhaines
coreyhaines / ping_of_death_chalkboard.erl
Created May 2, 2013 01:33
Chicago Software Craftsmanship Ping of Death Fun Times Galore Code for the game * Here's the server: https://github.com/patrickgombert/ping-of-death-server *Here's the client: https://github.com/patrickgombert/ping-of-death-client
-module(ping_of_death_chalkboard).
-export([answer/2, add_pairs/1]).
% ProblemName -> The name of the problem to solve
% Arguments -> The arguments for the problem as a list
%
% This function is expected to return the answer to the problem specified
% according to the arguments passed
%
% This function will be invoked when the ping of death arrives
@angel333
angel333 / DWM-ON-OS-X.md
Last active April 11, 2024 16:14 — forked from vangberg/DWM-ON-OS-X.md
Updated for .xinitrc.d and $USERWM, simplified

Installing and configuring dwm on OS X (tested on Mountain Lion, Mavericks)

  1. Install XQuartz.

  2. Install dwm using Homebrew (or whatever):

    brew install dwm
    
  3. Create a xinitrc.d script for dwm:

@seandenigris
seandenigris / gist:4945462
Last active December 13, 2015 17:08
Pharo Smalltalk SSH/SFTP Client
"Set the following variables, some of which have reasonable defaults, for your environment"
The required expect file lives at https://gist.github.com/seandenigris/4945436"
command := 'sftp'. "Tested with ssh and sftp"
userName := 'root'.
ipAddress := ''.
password := ''.
prompt := 'sftp> '.
expectFilePath := '/path/to/expect_file.exp'.
escapedPassword := password copyReplaceAll: '"' with: '\"'.
Running JRuby code with invokedynamic to show method inlining
def foo; 1; end
def invoker; foo; end
i = 0
while i < 10000
invoker
i+=1
end
@jamie
jamie / git-prune-origin
Created August 20, 2012 15:09
Script for removing remote branches which are fully merged into master
#!/usr/bin/env ruby
branches = `git branch -a`.split("\n")
remotes = branches.select{|e| e =~ %r(remotes/origin) && e !~ /HEAD/}
remotes.map!{|e| e.match(%r(origin/(.*)))[1] }
locals = branches.select{|e| e !~ %r(/) }
locals.map!{|e| e.match(/[^* ]+/)[0] }