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
| somemethod: function() { | |
| var _this = this; | |
| return function() { | |
| return _this.someCall(); | |
| }; | |
| } |
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
| foo = => @bar |
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
| var foo, | |
| _this = this; | |
| foo = function() { | |
| return _this.bar; | |
| }; |
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
| defn average | |
| numbers | |
| / | |
| apply + numbers | |
| count numbers |
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
| defn average | |
| numbers | |
| / | |
| apply + numbers | |
| count numbers |
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
| defn average | |
| numbers | |
| / | |
| apply + numbers | |
| count numbers |
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
| (defn even-or-odd [] | |
| (let [x (atom 1)] | |
| (fn [] | |
| (cond | |
| (even? @x) (println "I am even") | |
| (odd? @x) (println "I am odd")) | |
| (swap! x inc)))) | |
| (def I-am-even-odder (even-or-odd)) | |
| (I-am-even-odder) |
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 '[clojure.java.shell :as shell]) | |
| (require '[clojure.contrib.string :as string]) | |
| (def foo (-> (shell/sh "df" "-P") | |
| (:out) | |
| (string/split-lines) | |
| (map (fn [z] z)))) | |
| foo | |
| ; IllegalArgumentException Don't know how to create ISeq from: user$fn__2690 clojure.lang.RT.seqFrom (RT.java:505) |
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
| (defn transform-event [event options] | |
| (let [ event-path (event-to-vector event) | |
| state-values (find-state-thresholds event-path options) | |
| state (find-state (:metric event) state-values) | |
| new-event (assoc event :state state)] | |
| new-event)) | |
| (defn adjust-state [options & children] | |
| (fn [e] | |
| (let [ new-event (transform-event e options)] |
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
| defmodule Parser do | |
| def read(input) do | |
| tokens = Tokenizer.tokenize(input) | |
| parse tokens, [] | |
| end | |
| def parse([], stack) do | |
| stack | |
| end |