Skip to content

Instantly share code, notes, and snippets.

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();
}
➜ 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
DevicePolicyManager mDPM;
ComponentName mDeviceAdminSample;
int pwHistoryLength = 5;
mDPM.setPasswordHistoryLength(mDeviceAdminSample, pwHistoryLength);
> "v/sAurGIs0lo4?".match(/v\/(.+)\?/)[1]
'sAurGIs0lo4'
$(document).ready(function() {
var directions = {
'east': {
value: 1,
class: 'fromWest'
},
'southeast': {
value: 4,
class: 'fromNorthwest'
//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) {
<<<<<<< HEAD
=======
>>>>>>> logging
function something(options) {
var { hello = "world" } = options;
console.log(hello);
}
something({ hello: "lol" }); // -> hello lol
something({}); // -> hello world
➜ ~ 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]