This file contains 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 getImageDataURL(img) { | |
var data, canvas, ctx; | |
canvas = document.createElement('canvas'); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
ctx = canvas.getContext("2d"); | |
ctx.drawImage(img, 0, 0); | |
return canvas.toDataURL(); | |
} |
This file contains 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
➜ MacOS ./firefox | |
console.debug: [email protected] | |
ADB: | |
Asking for host:version | |
console.debug: [email protected] | |
ADB: | |
running checker onerror | |
console.debug: [email protected] | |
ADB: | |
running checker onclose |
This file contains 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
DevicePolicyManager mDPM; | |
ComponentName mDeviceAdminSample; | |
int pwHistoryLength = 5; | |
mDPM.setPasswordHistoryLength(mDeviceAdminSample, pwHistoryLength); |
This file contains 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
> "v/sAurGIs0lo4?".match(/v\/(.+)\?/)[1] | |
'sAurGIs0lo4' |
This file contains 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
$(document).ready(function() { | |
var directions = { | |
'east': { | |
value: 1, | |
class: 'fromWest' | |
}, | |
'southeast': { | |
value: 4, | |
class: 'fromNorthwest' |
This file contains 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
//Takes a url to JSON data and returns an object | |
function req(url, cb) { | |
var r = new XMLHttpRequest(); | |
r.open('GET', url, true); | |
r.onload = function() { | |
if(this.status != 200) return cb(new Error("Expected 200 got " + this.status)); | |
try { | |
var data = JSON.parse(this.response) | |
} catch(e) { |
This file contains 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
test |
This file contains 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
<<<<<<< HEAD | |
======= | |
>>>>>>> logging |
This file contains 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 something(options) { | |
var { hello = "world" } = options; | |
console.log(hello); | |
} | |
something({ hello: "lol" }); // -> hello lol | |
something({}); // -> hello world |
This file contains 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
➜ ~ npm update 6to5 -g --verbose | |
npm info it worked if it ends with ok | |
npm verb cli [ 'node', | |
npm verb cli '/usr/local/bin/npm', | |
npm verb cli 'update', | |
npm verb cli '6to5', | |
npm verb cli '-g', | |
npm verb cli '--verbose' ] | |
npm info using [email protected] | |
npm info using [email protected] |