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
| // Trying to use AST do determine _possible_ all calls to | |
| // `Foo.prototype.emit`. | |
| // I think I want to walk CallExpressions and look for | |
| // property.name === 'emit', which seems accurate enough | |
| // if not maybe giving false positives in mixed code with | |
| // actual EventEmitters and otherwise? | |
| class Foo { |
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
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
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 each(ar, cb){ | |
| for(var i = 0, l = ar.length; i < l; i++){ | |
| cb.call(ar[i], i, ar); | |
| } | |
| } | |
| function jerkify(obj, methods, thres){ | |
| each(methods, function(meth){ | |
| var orig = obj.prototype[meth]; | |
| orig && obj.prototype[meth] = function(){ |
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 attachpoint(selector){ | |
| return function(){ | |
| return this.$(selector); | |
| } | |
| } | |
| // eg: | |
| declare(WidgetBase, { | |
| $: function(selector){ | |
| return query(selector, this.domNode); |
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
| define([ | |
| "dojo", | |
| "dijit", | |
| "dijit/_Templated" | |
| ], function(dojo,dijit,_Templated){ | |
| /* | |
| mustache.js — Logic-less templates in JavaScript | |
| See http://mustache.github.com/ for more info. |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script> | |
| var list = [0, -1, 1, -1, 0, null, 1]; | |
| var sorter = function(direction){ | |
| // returns a sort function which treats `null` as a special case, either 'always higher' (1) | |
| // or 'always lower' (-1) |
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 zero(n){ | |
| n = n.length == 1 ? n + "0" : n; | |
| return +n; | |
| } | |
| function dollarsToHex(total){ | |
| var parts = total.toString(10).split("."); | |
| return parts.map(function(part){ | |
| return zero(part).toString(16); |
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
| define(["dojo"], function(dojo){ | |
| return function(node, command, args){ | |
| // summary: a magic function | |
| // example: | |
| // magic("foo", "byId"); | |
| // example: | |
| // magic(widget, "connect", "onClick", function(e){ }) | |
| // example: | |
| // magic("bar", "style", { color: "red" }); |
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
| String.prototype.repr = function(n){ | |
| return Array(n + 1).join(this); | |
| } | |
| String.prototype.lpad = function(/* Int */ length, /* String */ pad){ | |
| // summary: left pad this string to become `length` using an optional `pad` character | |
| return (pad || " ").repr(length - this.length) + this; | |
| } | |
| String.prototype.rpad = function(length, pad){ |
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
| Making output directory... | |
| source/dojox/html/metrics.rst:5: ERROR: The API Could not be fetched for dojox.html.metrics | |
| [] | |
| source/dojox/html/styles.rst:5: ERROR: The API Could not be fetched for dojox.html.styles | |
| [] | |
| source/dojox/rpc/JsonRPC.rst:5: ERROR: The API Could not be fetched for dojox.rpc.JsonRPC | |
| [] |
NewerOlder