Skip to content

Instantly share code, notes, and snippets.

@bmhatfield
bmhatfield / .profile
Last active August 9, 2025 20:28
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active January 15, 2025 00:34
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@Avaq
Avaq / combinators.js
Last active November 5, 2025 22:38
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@nygardk
nygardk / connect.js
Created January 13, 2016 16:08
Connect a component to Flux stores and map state to props
import React from "react";
const defaultConfig = {
addChangeListener: "addChangeListener",
removeChangeListener: "removeChangeListener",
};
function validateStoreMappings(storeMappings, config) {
if (!storeMappings) {
throw new Error("No storeMappings provided.");
-module(hashmap_eqc).
%% include some quickcheck headers
-include_lib("eqc/include/eqc.hrl").
-include_lib("eqc/include/eqc_statem.hrl").
%% include the eqc-c generated header
-include("hashmap.hrl").
%% function to initialize the model state
@haraldmartin
haraldmartin / MartinExtended.keylayout
Created November 20, 2015 10:29
Save to ~/Library/Keyboard Layouts/
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Last edited by Ukelele version 2.0b1 on 2010-01-18 at 17:01 (GMT+01:00)-->
<keyboard group="126" id="-2" name="Martin Extended" maxout="3">
<layouts>
<layout first="0" last="17" modifiers="commonModifiers" mapSet="ANSI"/>
<layout first="18" last="18" modifiers="commonModifiers" mapSet="JIS"/>
<layout first="21" last="23" modifiers="commonModifiers" mapSet="JIS"/>
<layout first="30" last="30" modifiers="commonModifiers" mapSet="JIS"/>
<layout first="194" last="194" modifiers="commonModifiers" mapSet="JIS"/>
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active September 25, 2025 14:56
An Open Letter to Developers Everywhere (About Cryptography)
(require 'cl)
(require 'ivy)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; General-purpose formatting functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ivy--cands-get-details (format_spec cand_info_fns entries)
"Extract symbols from FORMAT_SPEC, and evaluate the
corresponding function found in CAND_INFO_FNS for all ENTRIES.
For example:
(setq my_format_spec '(make-upper-case
@henrik
henrik / deploying_phoenix_on_dokku.md
Last active February 24, 2025 17:33
Deploying Elixir's Phoenix Framework on Dokku.

Deploying Phoenix on Dokku

Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.

These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.

On your local machine, in the app's repo

Create a Dokku app:

@jaibeee
jaibeee / brew-perms.sh
Last active January 4, 2025 01:23
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew