This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rvm install jruby | |
| jruby-1.6.7.2 - #downloading jruby-bin-1.6.7.2, this may take a while depending on your connection... | |
| jruby-1.6.7.2 - #extracting jruby-bin-1.6.7.2 to /Users/tony/.rvm/src/jruby-1.6.7.2 | |
| jruby-1.6.7.2 - #extracted to /Users/tony/.rvm/src/jruby-1.6.7.2 | |
| jruby-1.6.7.2 - #nailgun | |
| Error running 'jruby_install_build_nailgun', please read /Users/tony/.rvm/log/jruby-1.6.7.2/nailgun.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; 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) | |
| %) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Datomic example code | |
| (use '[datomic.api :only (db q) :as d]) | |
| ;; ?answer binds a scalar | |
| (q '[:find ?answer :in ?answer] | |
| 42) | |
| ;; of course you can bind more than one of anything | |
| (q '[:find ?last ?first :in ?last ?first] | |
| "Doe" "John") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Some example error messages resulting from common mistakes | |
| ;; using Datomic 0.8.4138 | |
| (ns errors | |
| (:use [datomic.api :as d :only (db q)])) | |
| (def uri "datomic:mem://database") | |
| (d/create-database uri) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'socket' | |
| socket = TCPSocket.new("stream.geoloqi.com", 40000) | |
| puts socket.recv(100) | |
| socket.write('your-access-token') | |
| socket.flush | |
| # The server outputs a confirmation message after connecting | |
| puts socket.recv(1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'rack' | |
| class Object | |
| def webapp | |
| class << self | |
| define_method :call do |env| | |
| func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
| [200, {}, send(func, *attrs)] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git checkout geocouch | |
| (in /root/build-couchdb) | |
| ** Invoke default (first_time) | |
| ** Invoke couchdb:clean_install (first_time) | |
| ** Invoke couchdb:build (first_time) | |
| ** Invoke erlang:build (first_time) | |
| ** Invoke known_distro (first_time) | |
| ** Invoke known_mac (first_time) | |
| ** Execute known_mac | |
| ** Invoke known_ubuntu (first_time) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Nitin Borwankar: So big picture question that helps me understand why I should spend time grokking evently - two part question | |
| Nitin Borwankar: a) why did you feel the need to create yet another framework b) what can I do with evently I couldn't do with | |
| jQuery events etc? | |
| Chris Anderson: evently was a natural consequence of using jquery | |
| Chris Anderson: it just wraps up all the repetitive crap I kept doing in jquery, and does it automatically | |
| Chris Anderson: so b) nothing | |
| Nitin Borwankar: ok cool | |
| Nitin Borwankar: second q | |
| Chris Anderson: I think evently was discovered not invented | |
| Nitin Borwankar: what are the component files of an evently minimal app (there's too much in a couchapp to tell what's essential |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'json' | |
| require 'isaac' | |
| configure do |c| | |
| c.nick = "icecondor" | |
| c.server = "irc.freenode.net" | |
| c.port = 6667 | |
| end | |
| on :connect do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $client = array('client_id' => 'geoloqi_web', 'client_secret' => '1234'); | |
| $post = array( | |
| 'grant_type' => 'password', | |
| 'username' => 'aaronpk', | |
| 'password' => '1234' | |
| ); |