(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # | |
| # Generate curl command from a Typhoeus request. | |
| # | |
| # Example: | |
| # | |
| # > request = Typhoeus::Request.post("http://example.com", {body: "fine stuff"}).request | |
| # > TyphoeusToCurl.new.to_curl(request) | |
| # | |
| # => "curl 'http://example.com' -X POST -H \"User-Agent: Typhoeus" -d 'fine stuff' --compressed" | |
| # |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
How to inform Eclipse and other Mac applications of the command line PATH
PATH.$ defaults write ~/.MacOSX/environment PATH "`echo $PATH`"
$ echo "setenv PATH $PATH" | sudo tee /etc/launchd.conf
| ;; It all started here: http://clojure-log.n01se.net/date/2011-04-06.html#19:04 | |
| (#((% (+(*))) %) ;; call arg 1 with all args | |
| [;; data | |
| (+ (*)(*)(*)(*)(*)(*)(*)) | |
| ;; main fn -- simulate 'if' with map lookup and closures | |
| #(({(+) (% (+(*)(*)))} ;; if zero return 'then' clause | |
| (% (+)) ;; dispatch on first arg | |
| (% (+(*)(*)(*)))) ;; call 'else' clause (n not found in map) | |
| %) |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| ;; Datomic example code | |
| ;; demonstrates various update scenarios, using a news database | |
| ;; that contains stories, users, and upvotes | |
| ;; grab an in memory database | |
| (use '[datomic.api :only (q db) :as d]) | |
| (def uri "datomic:mem://foo") | |
| (d/create-database uri) | |
| (def conn (d/connect uri)) |
| (use '[datomic.api :only [q db] :as d]) | |
| (def uri "datomic:mem://accounts") | |
| ;; create database | |
| (d/create-database uri) | |
| ;; connect to database | |
| (def conn (d/connect uri)) |
| require 'test_helper' | |
| shared_examples_for 'An Adapter' do | |
| describe '#read' do | |
| before do | |
| @adapter.write(@key = 'whiskey', @value = "Jameson's") | |
| end | |
| it 'reads a given key' do | |
| @adapter.read(@key).must_equal(@value) |