git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| Handlebars.JavaScriptCompiler.prototype.nameLookup = function(parent, name, type) { | |
| var result = '(' + parent + ' instanceof Backbone.Model ? ' + parent + '.get("' + name + '") : ' + parent; | |
| if (/^[0-9]+$/.test(name)) { | |
| return result + "[" + name + "])"; | |
| } else if (Handlebars.JavaScriptCompiler.isValidJavaScriptVariableName(name)) { | |
| return result + "." + name + ')'; | |
| } else { | |
| return result + "['" + name + "'])"; | |
| } | |
| }; |
| public interface FontResource extends ClientBundle | |
| { | |
| FontResource INSTANCE = GWT.create(FontResource.class); | |
| @Source("font1.otf") | |
| DataResource font1(); | |
| @Source("font2.otf") | |
| DataResource font2(); |
| define([ | |
| 'Backbone' | |
| ], function( | |
| Backbone | |
| ){ | |
| // I've evalled the entire file at this point, using cmd + A, cmd + Enter | |
| Backbone // cmd + Enter returns me `undefined`, although in the application, it would be the Backbone library object | |
| }) |
| var _ = require('underscore'); | |
| var Backbone = require('backbone'); | |
| var cheerio = require('cheerio'); | |
| var request = require('request'); | |
| Backbone.ajax = function(options) { | |
| options.json = true; | |
| return request(options, function(error, result) { | |
| if (error) { |
| var concat = require("concat-stream"); | |
| var hyperquest = require("hyperquest"); | |
| var Promise = require("bluebird"); | |
| var stream = require("stream"); | |
| // Wait for the request to finish or fail | |
| function promisify(req) { | |
| return new Promise(function (resolve, reject) { | |
| req.on("error", reject).pipe(concat({ encoding: "string" }, resolve)); |
| docker images | tail -n +2 | grep -v "none" | awk '{printf("%s:%s\n", $1, $2)}' | while read IMAGE; do | |
| echo $IMAGE | |
| filename="${IMAGE//\//-}" | |
| filename="${filename//:/-}.docker-image.gz" | |
| docker save ${IMAGE} | pigz --stdout --best > $filename | |
| done |
| /* | |
| * CSS like attribute parsing. | |
| * | |
| * Parses strings like `comp[name=myComp] > layer[name=myLayer light=true selected]` to objects. | |
| */ | |
| { | |
| function mergeProps(array){ | |
| var merged = {}; | |
| /* | |
| ** | |
| ** Example of Interprocess communication in Node.js through a UNIX domain socket | |
| ** | |
| ** Usage: | |
| ** server> MODE=server node ipc.example.js | |
| ** client> MODE=client node ipc.example.js | |
| ** | |
| */ |
In order to generate some svg with d3 in node.js, you need a dom. This is a bare bones example of using jsdom for said dom.