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
<html> | |
<body> | |
<form action="" method="post"> | |
<input type="hidden" name="userId" value="88a173b75668cb40fcd67a148c6f8918504c974a" /> | |
</form> | |
<script>document.forms[0].submit();</script> | |
<h1>Thanks</h1> | |
</body> | |
</html> |
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 bash | |
APP_ROOT="${0%/*}/.." | |
APP_DIST="$APP_ROOT/build" | |
mkdir -p "$APP_DIST" | |
cp "$APP_ROOT/src/env.json.tpl" "$APP_DIST/env.json" | |
# replace all {{VAR_NAME}} tokens with their corresponding environment variable value |
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
const frames = [ | |
{ name: "year", value: (d: number) => Math.floor(d / 29030400000) }, | |
{ name: "month", value: (d: number) => Math.floor(d / 2419200000) }, | |
{ name: "week", value: (d: number) => Math.floor(d / 604800000) }, | |
{ name: "day", value: (d: number) => Math.floor(d / 86400000) }, | |
{ name: "hour", value: (d: number) => Math.floor(d / 3600000) }, | |
{ name: "minute", value: (d: number) => Math.floor(d / 60000) }, | |
{ name: "second", value: (d: number) => Math.floor(d / 1000) }, | |
]; | |
function humanTimeDiff(date: Date, frame: number = 0) { |
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 merge(a: any, b: any): any { | |
return (a !== Object(a) || b !== Object(b)) | |
? b | |
: Object.keys(b).filter((k: string) => !a[k]).reduce( | |
(o: { [i: string]: any }, k: string) => { | |
o[k] = b[k]; | |
return o; | |
}, | |
Object.keys(a).reduce( | |
(o: { [i: string]: any }, k: string) => { |
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
/* | |
* Resolve requestAnimationFrame and cancelAnimationFrame regardless of whether window exists. | |
*/ | |
/* | |
* make window type index-able | |
*/ | |
interface IndexableWindow { | |
[key: string]: 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
// MergeValues merges multiple url.Values into a single url.Values result | |
func MergeValues(vs ...url.Values) url.Values { | |
result := url.Values{} | |
for _, values := range vs { | |
for k, v := range values { | |
result[k] = v | |
} | |
} | |
return result | |
} |
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
# | |
# Remove all but last subdirectories from all but last 2 directories in current directory | |
# | |
ls | head -n -2 | xargs -r ls | head -n -1 | xargs -r rm -rf | |
find . -mindepth 1 -maxdepth 1 -type d | \ | |
sort | head -n -1 | xargs -r -I {} find {} -mindepth 1 -maxdepth 1 -type d | \ | |
sort | head -n -1 | xargs -r rm -rf |
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
git tag --sort version:refname |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
// Task represents a callable task to be executed | |
type Task func() error |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
// Task represents a callable task to be executed | |
type Task func() |
NewerOlder