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
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
//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
$(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
> "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
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
➜ 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
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
function makePass(pass, done) { | |
crypto.randomBytes(10, function(err, bytes) { | |
if(err) return done(err); | |
var s = bytes.toString('hex'); | |
done(makeHash(pass, s)); | |
}); | |
} | |
function makeHash(pass, salt) { | |
return salt + "$" + require('crypto').createHmac('sha256', salt).update(pass).digest('hex'); |
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
➜ /tmp goingnative verify | |
✓ Found usable `gcc` in $PATH: v5.1.0 | |
✓ Found usable `python` in $PATH: v2.7.5 | |
✗ `node-gyp` not found in $PATH | |
# FAIL | |
Your solution to AM I READY? didn't pass. Try again! | |
➜ /tmp npm install -g node-gyp |