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 | |
# --------------------------------------------------------- | |
# Customizable Settings | |
# --------------------------------------------------------- | |
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}" | |
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}" | |
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}" | |
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}" |
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
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |
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
private BigInteger getBigIntegerFromUuid(UUID randomUUID) { | |
ByteBuffer bb = ByteBuffer.wrap(new byte[16]); | |
bb.putLong(randomUUID.getMostSignificantBits()); | |
bb.putLong(randomUUID.getLeastSignificantBits()); | |
return new BigInteger(bb.array()); | |
} |
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 isml () | |
"If sml repl exists, then restart it else create a new repl." | |
(interactive) | |
(when (get-buffer "*sml*") | |
(with-current-buffer "*sml*" | |
(when (process-live-p "sml") | |
(comint-send-eof))) | |
(sleep-for 0.2)) | |
(sml-run "sml" "")) |
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
-- Data from http://download.geonames.org/export/dump/ | |
-- More details at http://download.geonames.org/export/dump/readme.txt | |
-- Steps at https://gist.github.com/EspadaV8/1357237 | |
DROP TABLE geoname CASCADE; | |
CREATE TABLE geoname ( | |
geonameid INT, | |
name VARCHAR(200), | |
asciiname VARCHAR(200), |
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
;; Ruby has a short cut to specify an array of words: %w(apple bee carrot) → ["apple", "bee", "carrot"] | |
;; This can't be implemented in Ruby itself, and requires the language designers to implement this (in C). | |
;; Clojure, being a Lisp, allows anyone to add such a feature directly using a macro: | |
(defmacro %w [& args] `(map str '~args)) | |
(%w apple bee carrot) | |
;; → ("apple" "bee" "carrot") |
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
// It is important to declare your variables. | |
(function() { | |
var foo = 'Hello, world!'; | |
print(foo); //=> Hello, world! | |
})(); | |
// Because if you don't, the become global variables. | |
(function() { |