⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
F12 | go to definition |
⌘KB | toggle side bar |
This file contains 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
/*globals ActiveXObject*/ | |
// Cross browser Ajax implementation based on | |
// http://toddmotto.com/writing-a-standalone-ajax-xhr-javascript-micro-library/ | |
// https://gist.github.com/Xeoncross/7663273 | |
var encodeParams = function(data, bustCache) { | |
var key, | |
params = []; | |
for (key in data) { |
This file contains 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
; defining a function to square a number | |
user=> (defn square [x] (* x x)) | |
#'user/square | |
user=> (square 3) | |
9 | |
; now using an anonymous function | |
user=> (def square2 (fn [x] (* x x))) | |
#'user/square2 | |
user=> (square2 3) |
This file contains 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
; First let's show two alternative ways to destructure a vector | |
user=> (defn first-three [a & [b & [c]]] (println a b c)) | |
#'user/first-three | |
user=> (defn first-three [a b c & _] (println a b c)) | |
#'user/first-three | |
user=> (first-three 1 2 3 4) | |
1 2 3 | |
nil | |
user=> (first-three 1 2) | |
1 2 nil |
This file contains 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
// Basic `case` usage | |
val animal = "dog" | |
animal match { | |
case "dog" => "imadog" | |
case "cat" => "imacat" | |
case _ => "whatami" | |
} | |
// Pattern Matching with `case` | |
val DurhamWeather = ("cloudy", "durham") |