This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install git-extras | |
git undo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; -*- tab-width: 2 -*- | |
;;; These four lines go at the beginning of almost every code file. 16-byte iNES header | |
.inesprg 1 ; one bank of program code | |
.ineschr 1 ; one bank of picture data | |
.inesmap 0 ; we use mapper 0 | |
.inesmir 1 ; Mirror setting always 1 | |
;;; BANKING |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch to the master branch and make sure you are up to date. | |
git checkout master | |
git fetch # this may be necessary (depending on your git config) to receive updates on origin/master | |
git pull | |
# Merge the feature branch into the master branch. | |
git merge feature_branch | |
# Reset the master branch to origin's state. | |
git reset origin/master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -i tcp:8090 | grep LISTEN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn implementation-comparitor [f1 f2] | |
(let [f1-runtime (atom 0) | |
f2-runtime (atom 0) | |
performance-ratios (atom [])] | |
(fn [& args] | |
(let [f1-start (System/nanoTime) | |
_ (apply f1 args) | |
f1-time (- (System/nanoTime) f1-start) | |
f2-start (System/nanoTime) | |
return (apply f2 args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- solve-board [hints & {:keys [max-solutions], :or {max-solutions 1}}] | |
(let [vars (vec (repeatedly 81 lvar)) | |
rows (mapv vec (partition 9 vars)) | |
cols (apply map vector rows) | |
squares (for [corner-x (range 0 9 3) | |
corner-y (range 0 9 3)] | |
(for [x (range corner-x (+ corner-x 3)) | |
y (range corner-y (+ corner-y 3))] | |
(get-in rows [x y])))] | |
(run max-solutions [q] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
NUM_SECONDS_DELAY=1 | |
while "TRUE"; do | |
osascript -e 'tell application "Messages" to send "YO!" to buddy "+14151234567" of service "E:[email protected]"' | |
sleep $NUM_SECONDS_DELAY | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PEM files are Base-64 format starting with -----BEGIN. Extensions: .pem, .crt, .cer, .key | |
# DER files are binary versions. Extensions: .der, .cer | |
# Keystores: | |
# PKSC7/P7B - Base64. Extensions: .p7b, .p7c | |
# PKCS12/PFX - Binary. Extensions: .pfx, .p12 | |
# Generate a new private key | |
openssl genrsa -out private.pem 2048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git submodule update --init | |
git config --add fetch.recurseSubmodules true | |
git config alias.pull '!f(){ git pull "$@" && git submodule update --init --recursive; }; f' |