Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var swipeFunc = { | |
touches : { | |
"touchstart": {"x":-1, "y":-1}, | |
"touchmove" : {"x":-1, "y":-1}, | |
"touchend" : false, | |
"direction" : "undetermined" | |
}, | |
touchHandler: function(event) { | |
var touch; | |
if (typeof event !== 'undefined'){ |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #eee; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
'use strict' | |
let ary = [] | |
let obj1 = { | |
a: 1, | |
b: ary | |
} | |
ary.push(obj1) |
'use strict' | |
let bind = function (fn, obj) { | |
return function () { | |
fn.apply(obj, arguments) | |
} | |
} | |
let foo = function () { |
'use strict' | |
function baz() { | |
debugger | |
console.log('baz') | |
bar() | |
} | |
function bar() { | |
debugger |
'use strict' | |
let timeoutID1 = setTimeout(function(arg1, arg2) { | |
console.log(arg1) | |
console.log(arg2) | |
}, 2000, 'hello1', 'go1') | |
let timeoutID2 = setTimeout(function(arg1, arg2) { | |
console.log(arg1) | |
console.log(arg2) |
'use strict' | |
const repl = require('repl') | |
let r = repl.start("-> ") | |
let c = r.context | |
c.msg = "awesome repl" |
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
(defn gcd | |
[div rem] | |
(if (= rem 0) | |
div | |
(gcd rem (mod div rem)))) |