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
| var edge = require('./regex') | |
| // @return false or | |
| // @return string:version | |
| module.exports = function (ua) { | |
| var m = ua.match(edge) | |
| return !m ? false : m[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
| var safari = require('./regex') | |
| // @return false or | |
| // @return [string:version, boolean:is-mobile-safari] | |
| module.exports = function (ua) { | |
| var m = ua.match(safari) | |
| return !m ? false : [m[1], !!m[2]] | |
| } |
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 oxford (arr, last) { | |
| last = last || ', and ' | |
| return arr.reduce(function (a, b, i, arr) { | |
| return ( | |
| !arr[i + 1] ? a + b : | |
| !arr[i + 2] ? a + b + last : | |
| a + b + ', ' | |
| ) | |
| }, '') | |
| } |
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
| { "repos": ["wzrd-require"] } |
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 remote (name) { | |
| return 'greetings from the internet, ' + name | |
| } |
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
| var fs = require('fs') | |
| var jsonpatch = require('fast-json-patch') | |
| var pkg = require('./package.json') | |
| var patch = require('./patch')(pkg) | |
| var patches = jsonpatch.compare(pkg, patch) | |
| // We don’t want to remove keys missing from our patch. | |
| .filter(function (item) { | |
| return item.op !== 'remove' | |
| }) |
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
| pbpaste | tr '\012' '\003' | pbcopy |
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
| var sandboxed = require('sandboxed-module') | |
| var domino = require('domino') | |
| var domify = sandboxed.require('domify', { | |
| globals: { document: domino.createDocument() } | |
| }) | |
| var el = domify('<p>Hello, Dexter Morgan</p>') | |
| el.classList.add('message') | |
| console.log(el.outerHTML) |
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
| javascript:(function(){(function(){if(/github.io$/.test(location.host)){var%20paths=location.href.match(/^.+\/\/(.+)\.github\.io\/([^\/]+)?\/?.*$/).slice(1);location.href="https://github.com/"+paths[0]+"/"+(paths[1]||'')}else%20if(location.host=="github.com"){var%20paths=location.pathname.substr(1).split("/");location.href="http://"+paths[0]+".github.io/"+paths[1]}})()})(); |