Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
...
ss ()
{
name=$1;
shift;
echo $name;
TERM=screen screen -S $name -c $HOME/.screen/$name $*
}
// adapted from here: http://ostermiller.org/calc/encode.html
var base64 = {};
(function () {
var END_OF_INPUT = -1,
base64Chars = new Array(
'A','B','C','D','E','F','G','H',
'I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X',
'Y','Z','a','b','c','d','e','f',
@timcharper
timcharper / lein-completion.bash
Created April 15, 2010 18:06
bash completion for leiningen
_lein_test()
{
local curw
COMPREPLY=()
curw=${COMP_WORDS[COMP_CWORD]}
if [ -d test ]; then
COMPREPLY=($(compgen -W '$(cd test; find * -name \*.clj | sed "s/.clj\$//" | sed "s/_/-/g" | sed "s|/|.|g")' -- $curw));
return 0
fi
}
diff --git a/.bundle/environment.rb b/.bundle/environment.rb
index 4da4754..869468f 100644
--- a/.bundle/environment.rb
+++ b/.bundle/environment.rb
@@ -178,8 +178,8 @@ module Bundler
HOME = '/home/lt/.bundle/ruby/1.8/bundler'
AUTOREQUIRES = {:default=>[["RedCloth", false], ["SyslogLogger", false], ["coderay", false], ["haml", false], ["compass", false], ["rails", false], ["facets", false], ["formtastic", false], ["gemcutter", false], ["hoptoad_notifier", false], ["mongo", false], ["mongo_ext", false], ["mongo_mapper", false], ["rest-client", false]], :testing=>[["rake", false], ["ZenTest", false], ["autotest-fsevent", false], ["capybara", false], ["diff-lcs", false], ["cucumber", false], ["cucumber-rails", false], ["database_cleaner", false], ["email_spec", false], ["faker", false], ["launchy", false], ["rspec-core", false], ["rspec", false], ["rspec-rails", false], ["ruby-debug", false], ["shoulda", false], ["spork", false], ["test-unit", false]]}
SPECS = [
- {:name=>"rake", :
source 'http://rubygems.org'
gem "facets", "2.8.4"
The basic pivoting factor in economics is this: in a private economy, when
hardship arises, ingenuity is the solution, and when applied, wealth is
created. In a subsidized economy, when hardships come, the answer is "we
just need more money / resources", and when this is applied, wealth is
destroyed.
(defn map-queue
"Like map, but populated eagerly via fill-queue
(map-queue odd? (range 1 10) :queue-size 5) ;; will always calculate 5 ahead of the last used item from the lazy sequence"
[f coll & options]
(apply fill-queue (fn [fill] (doseq [value coll] (fill (f value)))) options))
(defn pmap-queue
"map-queue in parallel (using futures)
(pmap-queue odd? (range 1 10) :queue-size 5)"
[f coll & options]
(defmacro with-monitor
"Yields an object and a fn to tell if the object has been GC'd yet
The infinite loop (alive-fn) will quit when the return value (monitor) is no longer referenced and GC is run
(with-monitor [monitor alive?]
(let [alive-fn (fn [] (loop []
(println \"alive...\")
(java.lang.Thread/sleep 1000)
(when (alive?) (recur))))]
(ns clojure.contrib.condition.example
(:use clojure.contrib.condition))
(defn func [x y]
(if (neg? x)
(raise :type :arg :message "shouldn't be negative")
(+ x y)))
(defn run
[]