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
type Middleware interface { | |
ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) | |
} | |
func Compose(m Middleware) func(http.Handler) http.Handler { | |
return func(next http.Handler) http.Handler { | |
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { | |
m.ServeHTTP(rw, r, next.ServeHTTP) | |
}) | |
} |
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
// JSKeyFrameEffect to extend web-animations.js | |
function JSKeyFrameEffect(model, keyframes) { | |
if (keyframes.length === 0) { | |
if (console) { | |
console.warn('Must provide keyframes.'); | |
} | |
return function() {}; | |
} | |
if (keyframes[0].offset === undefined) { |
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() { | |
var hidden = "hidden"; | |
// Standards: | |
if (hidden in document) | |
document.addEventListener("visibilitychange", onchange); | |
else if ((hidden = "mozHidden") in document) | |
document.addEventListener("mozvisibilitychange", onchange); | |
else if ((hidden = "webkitHidden") in document) | |
document.addEventListener("webkitvisibilitychange", onchange); |
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 after(counter, callback) { | |
return function() { | |
if (--counter <= 0) { | |
if (callback) { | |
callback(); | |
} | |
} | |
}; | |
} |
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 getgist() { | |
curl -0 $1/download | tar -xz | |
set -- gist* | |
mv $1/* . | |
rmdir $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
var QueryString = function() { | |
// This function is anonymous, is executed immediately and | |
// the return value is assigned to QueryString! | |
var query_string = {}; | |
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 first entry with this name | |
if (typeof query_string[pair[0]] === "undefined") { |
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 python | |
# AppEngine Guardfile | |
# More info at https://github.com/lepture/python-livereload | |
from livereload.task import Task | |
from livereload.compiler import shell | |
def recursive_watch(directory, filetypes, *args, **kwargs): | |
import os |
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
# iterate through all git repos in projects folder | |
# fetch for any changes to remote | |
# for each branch, if it is different pull the changes and deploy | |
echo "Starting" | |
while true; do | |
for project in $(ls projects); do | |
echo "Checking for updates to $project" | |
cd "projects/$project" | |
branches=$(git remote -v update 2>&1 | grep -oEi "^\W+.*\w+$" | grep -v "up to date" | grep -oEi "\w+$") |
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
<?xml version="1.0" ?> | |
<CorsConfig> | |
<Cors> | |
<Origins> | |
<Origin>*</Origin> | |
</Origins> | |
<Methods> | |
<Method>GET</Method> | |
<Method>HEAD</Method> | |
<Method>OPTIONS</Method> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.