I hereby claim:
- I am leonardoborges on github.
- I am leonardoborges (https://keybase.io/leonardoborges) on keybase.
- I have a public key whose fingerprint is CD7B F319 99AE 74FF 4D3B 86CD B71B 49D1 0F1B F2EE
To claim this, I am signing this object:
| public enum Clazzes { | |
| param1 ("java.lang.String"), | |
| param2 ("java.util.ArrayList"); | |
| private final String clazz; | |
| Clazzes(String clazz) { | |
| this.clazz = clazz; | |
| } | |
| public Object get() throws Exception { | |
| return Class.forName(clazz).newInstance(); |
| #undo last commit | |
| git reset HEAD^ | |
| #show files in a given commit | |
| git show --pretty="format:" --name-only rev_number | |
| #remove untracked files and directories | |
| git clean -f -d | |
| #track remote branch |
| //I guess I'd go with straight functions into a module you could mixin or use directly OR objects... | |
| //On the first option, something like this: | |
| var app = app || {}; | |
| app.server = app.server || {}; | |
| app.server.http = function() {...}; | |
| app.server.get = function() {...}; | |
| app.server.post = function() {...}; | |
| //And for the second option: |
| # Install ZeroMQ | |
| sudo brew install zmq | |
| easy_install pyzmq | |
| [0] http://www.zeromq.org/bindings:python | |
| # Install OpenCV | |
| sudo brew install opencv | |
| # Install libusb |
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot = ev.robot; | |
| robot.rotateCannon(90); |
| threes = ["", "", "fizz"].cycle.lazy | |
| fives = ["", "", "", "", "buzz"].cycle.lazy | |
| (1..Float::INFINITY).lazy.zip(threes, fives).map{|n,f,b| | |
| if f.empty? && b.empty? | |
| return n | |
| elsif f.empty? | |
| return b | |
| else | |
| return [f,b].join |
| (require '[clojure.core.async :as async :refer :all]) | |
| (defn fake-search [kind] | |
| (fn [query] | |
| (Thread/sleep (int (* (java.lang.Math/random) 1000))) | |
| (str kind " result for " query))) | |
| (def web (fake-search "Web")) | |
| (def image (fake-search "Image")) | |
| (def video (fake-search "Video")) |
| ;; This is short but in case of a failure, it's harder to pinpoint which bit is wrong. | |
| (is (= (balance tree) | |
| [:red | |
| [:black | |
| [:black nil "a" nil] | |
| "x" | |
| [:black nil "b" nil]] | |
| "y" | |
| [:black |
| ;; Slides at: http://www.slideshare.net/borgesleonardo/monads-in-clojure | |
| ;; The list Monad | |
| (def list-m { | |
| :return (fn [v] (list v)) | |
| :bind (fn [mv f] | |
| (mapcat f mv)) | |
| }) | |
| (defn combinations [] |
I hereby claim:
To claim this, I am signing this object: