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
{ | |
"expo": { | |
"name": "Carvanro", | |
"description": "A simple, quick, cheap and fun way to commute together", | |
"slug": "Carvanro", | |
"privacy": "public", | |
"sdkVersion": "24.0.0", | |
"version": "1.1.0", | |
"platforms": ["android"], | |
"orientation": "portrait", |
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
const testPageJSON = { | |
"children": [ | |
{ | |
"el": "div", | |
"props": { | |
"style": { | |
"background": "green" | |
} | |
}, | |
"children": [ |
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
const HOURS = [ | |
'05', '06', '07', '08', '09', '10', '11', '12', | |
'13', '14', '15', '16', '17', '18', '19', '20', | |
'21', '22', '23', '00', '01', '02', '03', '04', | |
] | |
/* | |
* Converts ['05'] to {'05': '05'} | |
*/ | |
const arrayToOptionsObject = (array => ( |
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
// Paste and run in console! | |
alert(["0707", 92042, 697, 2746, 8646, 1792, 1].reduce(function(a, b) { | |
return a + b.toString() | |
}, "48617").split("").map(function(s, i, list) { | |
var x; | |
if (i % 2) x = list[i + 1] + (list[i + 2] || ""); | |
if (i == 0) x = list[0] + list[1]; | |
return x; | |
}).filter(function(item) { | |
return typeof item === 'string'; |
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
// Example implementation: http://jsfiddle.net/2f7w2fpn/ | |
var indent = 1; | |
function walk(tree) { | |
tree.forEach(function(node) { | |
console.log('--' + Array(indent).join('--'), node.key); | |
if(node.children) { | |
indent ++; | |
walk(node.children); | |
} |
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
/* | |
* Disregard the fact that I'm using Array.forEach here | |
*/ | |
TestCase("ReadyStateHandlerTest", { | |
"test should call failure handler for 404, 400, 500": function() { | |
var _this = this; | |
[400, 404, 500].forEach(function(status) { | |
var request = forceStatusAndReadyState(_this.xhr, status, 4) | |
assert(request.failure); |
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
// dust.js template pre-compilation | |
var template = dust.compile("Hello {name}!"); | |
// compiles to this string: | |
// | |
// '(function() { | |
// dust.register("demo", body_0); | |
// | |
// function body_0(chk, ctx) { |
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
<!doctype html> | |
<html> | |
<head> | |
<style> | |
.theme { | |
width:400px; | |
margin:0 2px; | |
padding: 10px; |
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
find -name "*.py" | xargs perl -p -i -e 's/\s+\n/\n/g' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8> | |
<title>IE input value</title> | |
</head> | |
<body> | |
<form action=""> | |
<input id="test" type="text" name="username"> | |
</form> |
NewerOlder