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
$(function() { | |
var $ri = $(".review-info"); | |
if ($ri.length === 1) { | |
var search = $("h1, h2", $ri).text().replace(/(\r\n|\n|\r)/gm,"").replace(/\s+/g, " ").trim(); | |
if (search !== "" && search !== []) { | |
$("body").prepend($("<div />") | |
.html($("<div />") | |
.html($("<a />") | |
.attr("href", "spotify:search:'" + search + "'") | |
.attr("style", "color: white;") |
; synchronous api call helper | |
(defmacro with-client [uri verb-fn & body] | |
`(with-open [~'client (client/create-client)] | |
(let [~'response (~verb-fn ~'client ~uri :auth auth)] | |
~@body))) | |
; helpers | |
(def job-names | |
(memoize | |
(fn [] |
:dependencies [[org.clojure/clojure "1.3.0"], | |
[org.clojars.adamwynne/http.async.client "0.4.1"] | |
[org.danlarkin/clojure-json "1.2-SNAPSHOT"] | |
[robert/hooke "1.1.2"]] | |
:dev-dependencies [[org.clojars.scott/lein-nailgun "1.1.0"]] |
@providers = new plumage.display.model.Providers( | |
for provider in plumage.bootstrap.providers | |
new plumage.display.model.Provider {id: provider.id, providerName: provider.name} | |
) |
provide 'jQuery', this.$ | |
provide 'underscore', this._ | |
provide 'backbone', this.Backbone |
var facets = [{facetValue: { value: 1, count: 10 }}, {facetValue: {value: 2, count: 7}}]; | |
_.pluck(_.pluck(facets, "facetValue"), "value"); |
:password => ENV['password'] || 'asdf' |
my_chpwd() | |
{ | |
if [[ -s "$PWD/.set_env" ]] ; then | |
source "$PWD/.set_env" | |
echo '(automatically sourced .set_env)' | |
fi | |
} | |
add-zsh-hook chpwd my_chpwd |
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
@var = "hello | |
this is a very long string | |
it doesn't seem to put any | |
returns in it"; |