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/sh | |
untrackedFiles=$(git ls-files --others --exclude-standard) | |
if [ ! -z "$untrackedFiles" ] | |
then | |
echo "There are untracked files in the working tree:" | |
echo "$untrackedFiles" | |
echo "" | |
echo "Are you sure you aren't forgetting something?" |
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 add-component | |
[system entity component data] | |
(-> system | |
(update-in [:identity entity] (comp set conj) component) | |
(assoc-in [component entity] data))) | |
(defn delete-component | |
[system entity component] | |
(-> system | |
(update-in [:identity entity] disj component) |
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
(defun definitely-speedbar () | |
(interactive) | |
(speedbar t)) | |
(global-set-key [f11] 'definitely-speedbar) |
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
#!/usr/bin/ruby | |
# uniq-live | |
# | |
# Reads from stdin or a given file and counts the number of times a | |
# given line repeats as it is read. | |
last = nil | |
count = 1 | |
while !ARGF.eof? && line = ARGF.readline.strip do |
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 | |
for branch in $(git branch --merged | grep -v '*') | |
do | |
read -n 1 -p "Delete ${branch} [y/N]? " answer | |
echo "" | |
if [[ "$answer" = "y" ]] | |
then | |
git branch -d "$branch" | |
fi |
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
function arrayAssocIn(obj, keys, val) { | |
var m = obj; | |
for (var ii = 0; ii < keys.length - 1; ii++) { | |
var k = keys[ii]; | |
m = m[k] = m[k] || []; | |
} | |
m[keys[keys.length - 1]] = val; | |
return obj; |
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
(defonce handlers (atom {})) | |
(defn- install-handler! | |
[topic-key f] | |
(swap! handlers assoc topic-key f)) | |
(defmacro on | |
"Registers a global message handler for the given topic keyword. A | |
single handler can be registered at a time for a given topic | |
keyword. Handlers are dispatched based on the name portion of the |
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
class Integer | |
def to_a | |
(0..Math.log2(self).ceil).map {|idx| self[idx] }.reverse | |
end | |
end |
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
;; an appropriate prelude... | |
(def parpar (partial partial partial)) | |
(def parapply (parpar apply)) | |
(def parconj (parpar conj)) | |
;; one convenient constant | |
(def char-offset (int \A)) |
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
(ns stackity.stack) | |
(defn compile-mode? | |
[stack] | |
(-> stack meta :mode (= :compile))) | |
(def interpret-mode? (complement compile-mode?)) | |
(defn ->compile-mode | |
[stack] |
NewerOlder