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
function fetchNCache(e) { | |
return fetch(e).then(function(t) { | |
if (200 !== t.status) | |
return Promise.resolve(t); | |
const n = t.clone(); | |
return caches.open(cacheName).then(function(s) { | |
return requestExpectsHtml(e) && !responseIsHtml(n) ? Promise.resolve(t) : void s.put(e.url, n) | |
}), | |
Promise.resolve(t) | |
}) |
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
declare module 'react-table' { | |
import * as React from "react"; | |
interface SortMethod { | |
id: string; | |
desc: boolean | |
} | |
export type ColumnAccessor<T> = (o: T) => any |
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
import test from 'ava'; | |
import Rx from 'rxjs/Rx'; | |
import {createStore} from 'redux'; | |
test('should be observable', t => { | |
const reducer = (state, action) => { | |
if (action.type === 'increment') { | |
return {...state, counter: state.counter + 1} | |
} |
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
# Start an HTTP server from a directory, optionally specifying the port | |
function server() { | |
local port="${1:-8000}"; | |
sleep 1 && open "http://localhost:${port}/" & | |
# Set the default Content-Type to `text/plain` instead of `application/octet-stream` | |
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) | |
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"; | |
} |
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
runtime = electron | |
target = 0.36.7 | |
target_arch = x64 | |
disturl = https://atom.io/download/atom-shell |
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
<!DOCTYPE html> | |
<html{% if(o.htmlWebpackPlugin.files.manifest) { %} manifest="{%= o.htmlWebpackPlugin.files.manifest %}"{% } %}> | |
<head> | |
<meta charset="UTF-8"> | |
<title>{%=o.htmlWebpackPlugin.options.title || 'Webpack App'%}</title> | |
{% if (o.htmlWebpackPlugin.files.favicon) { %} | |
<link rel="shortcut icon" href="{%=o.htmlWebpackPlugin.files.favicon%}"> | |
{% } %} | |
{% for (var css in o.htmlWebpackPlugin.files.css) { %} | |
<link href="{%=o.htmlWebpackPlugin.files.css[css] %}" rel="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
function docker | |
set -l DOCKER (which docker) | |
if not set -q DOCKER_HOST | |
set -g DOCKER_IP (boot2docker ip) | |
set -gx DOCKER_HOST "tcp://$DOCKER_IP:2376" | |
set -gx DOCKER_CERT_PATH ~/.boot2docker/certs/boot2docker-vm | |
set -gx DOCKER_TLS_VERIFY 1 | |
echo "Set docker host: $DOCKER_HOST" | |
end |
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 gulp = require('gulp'); | |
var downloadelectron = require('gulp-download-electron'); | |
var shell = require('gulp-shell'); | |
var packageJson = require('./package.json'); | |
var electron = require('gulp-electron'); | |
gulp.task('package', function() { | |
gulp.src("") | |
.pipe(electron({ | |
src: '.', |
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
#!/usr/bin/env node | |
var inquirer = require("inquirer"), | |
slugify = require("underscore.string/slugify"), | |
fs = require('fs'), | |
multiline = require('multiline'), | |
format = require("string-template"), | |
dateFormat = require('dateformat'); | |
opt = require('node-getopt').create([ |