This file contains hidden or 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
class StorageDriver { | |
constructor (conf = {}) { | |
this.conf = conf | |
if ( | |
typeof this.conf.storage.getItem !== 'function' || | |
typeof this.conf.storage.removeItem !== 'function' || | |
typeof this.conf.storage.setItem !== 'function' | |
) { | |
throw new Error('Given Storage doesn\'t have methods `getItem`, `setItem` and `removeItem`.') |
This file contains hidden or 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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, |
This file contains hidden or 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
"use strict"; | |
var decimalOnly = /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/; | |
var cleanText = (function (textin) { | |
return textin.replace(/[^\w-]/g, '').toLowerCase(); | |
}); | |
var express = require('express'); | |
var router = express.Router(); | |
var request = require("request"); | |
var squareBaseURLv1 = "https://connect.squareup.com/v1/"; | |
var squareBaseURLv2 = "https://connect.squareup.com/v2/"; |
This file contains hidden or 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
{"lastUpload":"2016-10-12T18:39:35.964Z"} |
This file contains hidden or 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
{} |
This file contains hidden or 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
let bytesText = function formatBytesText(bytes) { | |
if(bytes < 1024) return bytes + " Bytes"; | |
else if(bytes < 1048576) return(bytes / 1024).toFixed(2) + " KB"; | |
else if(bytes < 1073741824) return(bytes / 1048576).toFixed(2) + " MB"; | |
else return(bytes / 1073741824).toFixed(2) + " GB"; | |
}; | |
This file contains hidden or 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
var webComponentsSupported = ('registerElement' in document | |
&& 'import' in document.createElement('link') | |
&& 'content' in document.createElement('template')); | |
if (!webComponentsSupported) { | |
var wcPoly = document.createElement('script'); | |
wcPoly.src = '/../bower_components/webcomponentsjs/webcomponents-lite.js'; | |
wcPoly.onload = lazyLoadPolymerAndElements; | |
document.head.appendChild(wcPoly); | |
} else { |
This file contains hidden or 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
var decimalOnly = /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/; |
This file contains hidden or 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
STARTUP_VERSION=1 | |
PARTITION_MARK=/var/startup.partition.$STARTUP_VERSION | |
RESIZE_MARK=/var/startup.resize.$STARTUP_VERSION | |
# Repartition the disk to full size | |
function partition() { | |
start_sector=$(sudo fdisk -l | grep ^/dev/sda1 | awk -F" " '{ print $3 }') | |
cat <<EOF | sudo fdisk -c -u /dev/sda | |
d |
This file contains hidden or 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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-animated-pages/core-animated-pages.html"> | |
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html"> | |
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html"> | |
<link rel="import" href="../core-animated-pages/transitions/slide-down.html"> |
NewerOlder