Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian Descottes juliandescottes

View GitHub Profile
View getpath.js
module.exports = function (object, path) {
var parts = path.split ? path.split(".") : path;
try {
var node = object;
parts.forEach(function (part) {
node = node[part];
});
return node;
} catch (e) {
View gist:a9e9ba1ab8229653109c
hg up fx-team
hg pull -u fx-team
hg up my-feature
hg rebase -d fx-team
View gist:f37cca34f1e1e574a1fd
[[1,2],[3,4],[5,6]].reduce(function (previous, n) {
return previous.concat(n)
}, [])
View gist:2a27b98ed5ba5d22a392
http://lorempixel.com/640/480/abstract/
View gist:d04ceceb03fbbe0164a3
var people = [
{name : "Zoe", age : 20},
{name : "Alicia", age : 18},
{name : "John", age : 22}
];
people.sort(function (p1, p2) {
return p1.name.localeCompare(p2.name);
});
@juliandescottes
juliandescottes / gist:7f95e3056a035fe308c9
Created May 11, 2015
Mozilla locales are in /toolkit (even devtools ones)
View gist:7f95e3056a035fe308c9
eg \toolkit\locales\en-US\chrome\global\devtools\styleinspector.properties
View gist:8a9f338a4eb87beb41db
"show dbs"
"show collections"
"db.dropDatabase()"
View gist:98ca63cd76fcb3de877d
List
- run "npm outdated"
Update
- replace versions in package.json by '*'
- run "npm update --save"
@juliandescottes
juliandescottes / gist:30973b88033784008f26
Last active Aug 29, 2015
hg log from current revision
View gist:30973b88033784008f26
hg log --rev "reverse(ancestors(.))"
y - record this change
n - skip this change
s - skip remaining changes to this file
f - record remaining changes to this file
d - done, skip remaining changes and files
a - record all changes to all remaining files