A lightweight node port of websocketd, originally written in go.
node-websocketd --port=8080 ./count.sh| // Boring | |
| if (isThisAwesome) { | |
| alert('yes'); // it's not | |
| } | |
| // Awesome | |
| isThisAwesome && alert('yes'); | |
| // Also cool for guarding your code | |
| var aCoolFunction = undefined; |
| module curved_triangle(r, pitch, separation, gap) { | |
| assign(num_steps = 36) | |
| assign(top_d = pitch - 2 * separation) | |
| assign(bottom_d = triangle_tip_width) | |
| assign(delta = top_d - bottom_d) | |
| assign(d_incr = delta / (num_steps-1)) | |
| assign(b_incr=116/(num_steps - 1)) | |
| render() | |
| for (i=[0:(num_steps-2)]) { | |
| hull() { |
A lightweight node port of websocketd, originally written in go.
node-websocketd --port=8080 ./count.sh| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Building a router</title> | |
| <script> | |
| // Put John's template engine code here... | |
| (function () { | |
| // A hash to store our routes: |
| function retry(isDone, next) { | |
| var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
| var id = window.setInterval( | |
| function() { | |
| if (isDone()) { | |
| window.clearInterval(id); | |
| next(is_timeout); | |
| } | |
| if (current_trial++ > max_retry) { | |
| window.clearInterval(id); |
It seems that Chrome finally found a way to let us convert from svg to canvas to png without the tainted canvas security feature/bug.
| # Please make this file available to others | |
| # by sending it to <[email protected]> | |
| # | |
| # this config file was automatically generated | |
| # using lirc-0.9.0-pre1(default) on Sat Dec 7 19:14:59 2013 | |
| # | |
| # contributed by | |
| # | |
| # brand: lirc-pda.conf | |
| # model no. of remote control: |
| birthday = Date.parse('2013/03/27'); | |
| age = ~~((Date.now() - birthday) / (31557600000)); |
| #!/usr/bin/env node | |
| // Solve the "Coin Change" problem using a bottom-up dynamic programming | |
| // approach. The time complexity is O(n * coins.length) since we have a nested | |
| // loop. The storage complexity is the same, as we store a matrix. | |
| // | |
| // * `coins` is an array of the coin values, eg. [ 1, 2, 3 ]. We assume it | |
| // to be non-empty. | |
| // * `n` is the amount, eg. 4 cents. | |
| // |
| <!doctype html> | |
| <html> | |
| <title>Flatten.js, General SVG Flattener</title> | |
| <head> | |
| <script> | |
| /* | |
| Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/ | |
| Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/ |