This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/usr/bin/env ruby | |
# A simply utility to show character counts for each line of input and | |
# highlight lines longer than 80 characters. | |
# | |
# Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html | |
# | |
# Examples: | |
# | |
# $ hilong Gemfile |
Originally: | |
https://gist.github.com/7565976a89d5da1511ce | |
Hi Donald (and Martin), | |
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I | |
appreciate the tone. This is a Yegge-long response, but given that you and | |
Martin are the two people best-situated to do anything about this, I'd rather | |
err on the side of giving you too much to think about. I realize I'm being very | |
critical of something in which you've invested a great deal (both financially |
#!/usr/bin/env lein-exec | |
(println (group-by (fn [e] (if e true false)) [true, false, -1, 0, 1, 2, nil, (new Object), [], #{}, '(), [(new Object)], {}, {:foo, (new Object)}])) | |
;;{true [true -1 0 1 2 #<Object java.lang.Object@4d8ce14a> [] #{} () [#<Object java.lang.Object@48ff4cf>] {} {:foo #<Object java.lang.Object@7114460>}], false [false nil]} |
import groovyx.gpars.dataflow.DataFlowQueue | |
import groovyx.gpars.dataflow.operator.DataFlowPoisson | |
import static groovyx.gpars.dataflow.DataFlow.operator | |
import java.util.concurrent.atomic.AtomicInteger | |
def upstream = new DataFlowQueue() // empty trays travel back upstream to the producer | |
def downstream = new DataFlowQueue() // trays with products travel to the consumer downstream | |
def prodWiring = [inputs: [upstream], outputs: [downstream], maxForks: 3 ] // maxForks is optional | |
def consWiring = [inputs: [downstream], outputs: [upstream], maxForks: 3 ] // maxForks is optional |
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
sudo apt-get update | |
sudo apt-get upgrade |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
// if you're going to send back... | |
{ | |
'status' : 'Failure', | |
'message' : 'Resource creation failed', | |
'errors' : ['Problems creating resource in the system'] | |
} | |
// ... you might as well just save everyone the trouble and send back... | |
{ 'shit happened': true } |
From http://everything2.com/title/nontheist
The Buddha is the first historically known nontheist. Most Buddhists are nontheist.
The Buddha was often asked whether God existed. Usually, he replied with a complete silence. Once, however, he told the story of the man shot by a poisoned arrow.
When the doctor came and wanted to pull the arrow out of the wound, the man grabbed the doctor's hand and asked:
"Before you start treating me, Doctor, tell me, who was it that shot me? Was he of warrior class or some other class? Was he tall or was he short? Was he young or was he old? Was he dark skinned or light skinned?"
# Earl: Strings that do web things | |
# | |
# | |
# Examples: | |
# | |
# text = "Blah blah http://tinyurl.com/4bnjzbu blah http://tinyurl.com/4tefu9f" | |
# | |
# text.urls # => ["http://tinyurl.com/4bnjzbu", "http://tinyurl.com/4tefu9f"] | |
# | |
# text.locations # => ["http://nutrun.com/weblog/2010/11/17/supercharged-ruby-console-output.html", "http://nutrun.com"] |
FooNamespace.Routes = { | |
myResourcePath: function(){ return '<%= my_resource_path(:format => 'json') %>' } | |
} |