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
# Print a tag name conforming to the React experimental guidelines | |
# https://reactjs.org/docs/release-channels.html#experimental-channel | |
echo "0.0.0-experimental-$(git rev-parse HEAD | cut -c1-9)-$(date +'%Y%m%d')" |
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
/** | |
* Approximate `npm prune --production` using `yarn remove`. | |
* @see https://github.com/yarnpkg/yarn/issues/696 | |
*/ | |
const exec = require('child_process').exec; | |
const devDependencies = Object.keys(require('./package.json').devDependencies).join(' '); | |
const command = 'yarn remove ' + devDependencies; | |
const child = exec(command, (err, stdout, stderr) => { | |
if (err) throw err; |
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
import {Injectable, NgModuleFactory, NgModuleFactoryLoader, Compiler, Type} from '@angular/core'; | |
class LoaderCallback { | |
constructor(public callback) {} | |
} | |
export let load: Type = (callback: Function) => { | |
return new LoaderCallback(callback); | |
}; |
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
/** | |
* Lightweight script to convert touch handlers to mouse handlers | |
* credit: http://stackoverflow.com/a/6141093 | |
*/ | |
(function() { | |
function touchHandler(e) { | |
var touches = e.changedTouches; | |
var first = touches[0]; | |
var type = ""; |
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
# HTML5 pushState nginx configuration | |
# | |
# @see: http://stackoverflow.com/a/30515169/1774183 | |
# | |
# Server block for a client side app with directories: | |
# | |
# / | |
# /foo | |
# /foo/bar | |
# /foo/bar/baz |
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
/** | |
* CasperJS .bind() | |
* | |
* Adds .bind() capability missing from PhantomJS < 2.0.0 for CasperJS. | |
* Needed for some types of evaluations on the remote page as well as | |
* screenshots. | |
*/ | |
casper.on('page.initialized', function() { | |
casper.evaluate(function() { | |
var isFunction = function(o) { |
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
// https://css-tricks.com/snippets/javascript/get-url-variables/ | |
// cleaned up a bit | |
function getQueryVariable(variable) { | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i = 0; i < vars.length; i++) { | |
var pair = vars[i].split("="); | |
if (pair[0] === variable) { |
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
/** | |
* Utility to count watchers in an AngularJS app. | |
*/ | |
function countWatchers() { | |
var root = angular.element(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
if (element.data().hasOwnProperty('$scope')) { |
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
[mysql] | |
# CLIENT # | |
port = 3306 | |
[mysqld] | |
# GENERAL # | |
user = mysql |
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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |