Skip to content

Instantly share code, notes, and snippets.

View danielstocks's full-sized avatar
🏠
Working from home

Daniel Stocks danielstocks

🏠
Working from home
View GitHub Profile
// 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';
@danielstocks
danielstocks / arrayToOptionsObject.jsx
Last active September 4, 2017 13:05
arrayToOptionsObject.js
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 => (
const testPageJSON = {
"children": [
{
"el": "div",
"props": {
"style": {
"background": "green"
}
},
"children": [
@danielstocks
danielstocks / app.json
Created March 2, 2018 13:49
Expo Configuration FIle
{
"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",