- Only first pass complete: raw translation from Java example to Scala.
- Second pass [incomplete]: abstracting to make server and client specific code composable.
- Create declarative and composable Pipeline definition
(defun chomp (str) | |
"Chomp leading and tailing whitespace from STR." | |
(while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'" str) | |
(setq str (replace-match "" t t str))) str) | |
(defun get-keychain-password (account-name) | |
"Gets `account` keychain password from OS X Keychain" | |
(chomp | |
(shell-command-to-string | |
(concatenate |
require 'riak/cluster' | |
cluster = Riak::Cluster.new(:count => 4, :source => "/usr/local/Cellar/riak/1.0.3/libexec/bin", :root => "~/mycluster") | |
cluster.create | |
cluster.start | |
cluster.join |
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
/twistd.pid | |
/_trial_temp/ |
module Main where | |
import Test.QuickCheck (quickCheck) | |
import Your.Module (encrypt, decrypt) | |
prop_reverseReverse :: [Char] -> Bool | |
prop_reverseReverse s = (reverse . reverse) s == s | |
prop_encryptDecrypt :: [Char] -> Bool | |
prop_encryptDecrypt s = (encrypt . decrypt) s == s |
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p286 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
!------------------------------------------------------------------------------- | |
! Xft settings | |
!------------------------------------------------------------------------------- | |
Xft.dpi: 96 | |
Xft.antialias: false | |
Xft.rgba: rgb | |
Xft.hinting: true | |
Xft.hintstyle: hintslight |
require 'active_support/time' | |
bucket = Fog::Storage.new(:provider => 'AWS').directories.select {|d| d.key == 'my_bucket'} | |
files = bucket.files.select {|f| f.content_length > 0 && | |
f.key =~ %r{client-name.*\.zip}} | |
expiration = Time.now.next_month.end_of_month | |
signed_urls = files.map {|f| f.url(expiration)} | |
fixed_signed_url = signed_urls.map do |su| | |
su.sub(%r{s3\.(.*)/my_bucket}, "my_bucket.s3.#{$1}") | |
end |
(defn watch | |
"Returns (running) thread which observes the value of f every delay | |
milliseconds, and calls the callback fn if the value changes. callback | |
will be called with the old and new values from f" | |
([f callback delay] | |
(let [proc (fn [] | |
(loop [x1 ::watch-init] | |
(let [x2 (f)] | |
(when (not= x1 x2) | |
(callback x1 x2)) |