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
# | |
# Please don't use this in any Ruby library or code. | |
# This is for proof-of-concept purposes only and will break Ruby functionality | |
# | |
class Proc | |
alias :greedy_curry :curry | |
def curry | |
if self.has_kwarg_parameters? |
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
class Identity | |
def initialize(obj) | |
@obj = obj | |
end | |
def self.wrap(obj) | |
Identity.new(obj) | |
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
obj = "hello"; puts obj.methods.map {|m| obj.method(m)} | |
#<Method: String#<=>> | |
#<Method: String#==> | |
#<Method: String#===> | |
#<Method: String#eql?> | |
#<Method: String#hash> | |
#<Method: String#casecmp> | |
#<Method: String#+> | |
#<Method: String#*> |
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
puts `git ls-tree HEAD -r -t -l`.split("\n").map {|l| tabs = l.scan('/').length; " "*tabs + l.split.last.split('/').last} |
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
Areas of programming to get good at | |
Computer Science | |
Algorithms | |
Data Structures | |
Time/Space complexities | |
Coding | |
Collections | |
Arrays | |
Key-Value stores |
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
;function fib(n) { | |
; var next, acc = 1, 0; | |
; while(n > 0) { | |
; next, acc = next + acc, next; | |
; n--; | |
; } | |
; return acc; | |
;} | |
(defn fib [n next acc] |
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
# This is O(n^2), it is NOT the FFT | |
require 'complex' | |
# This is our data | |
arr = [1,-1]*50 | |
# This is the number of harmonics we wish to calculate | |
n_max = 20 | |
# This is what will hold the result |
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
(ns ^:figwheel-no-load reagenttest.dev | |
(:require [reagenttest.core :as core] | |
[figwheel.client :as figwheel :include-macros true])) | |
(enable-console-print!) | |
(figwheel/watch-and-reload | |
:websocket-url "ws://localhost:3449/figwheel-ws" | |
:jsload-callback core/mount-root) |
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
(defproject reagenttest "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.7.0"] | |
[ring-server "0.4.0"] | |
[reagent "0.5.1"] | |
[reagent-forms "0.5.9"] |
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
(ns reagenttest.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[reagent.session :as session] | |
[secretary.core :as secretary :include-macros true] | |
[goog.events :as events] | |
[goog.history.EventType :as EventType]) | |
(:import goog.History)) | |
;; ------------------------- | |
;; Views |