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
My name is {{.Name}} and I'm {{.Age}} years old!! |
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
#!/bin/bash | |
GFWLIST=https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt | |
PROXY=127.0.0.1:7070 | |
cd `dirname "${BASH_SOURCE[0]}"` | |
echo "Downloading gfwlist from $GFWLIST" | |
curl "$GFWLIST" --socks5-hostname "$PROXY" > /tmp/gfwlist.txt | |
/usr/local/bin/gfwlist2pac \ | |
--input /tmp/gfwlist.txt \ |
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
# Source: https://gist.github.com/5212628 | |
# | |
# All-purpose gist tool for Pythonista. | |
# | |
# When run directly, this script sets up four other scripts that call various | |
# functions within this file. Each of these sub-scripts are meant for use as | |
# action menu items. They are: | |
# | |
# Set Gist ID.py - Set the gist id that the current file should be | |
# associated with. |
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
#!/bin/sh | |
for d in $(find . -maxdepth 1 -type d) | |
do | |
if [ $d != '.' ]; then | |
echo -ne "$d " | |
zip -r -m "$d.zip" "$d" | |
fi | |
done |
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
function cdf() # cd to Finder's front window's path | |
{ | |
path="`osascript -e 'tell application "Finder" to set myname to POSIX path of (target of window 1 as alias)' 2>/dev/null`" | |
if [ -n "$path" ]; then | |
echo "cd to $path" | |
cd "$path" | |
else | |
echo "no Finder window found" | |
fi | |
} |
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
// original post: https://groups.google.com/d/msg/golang-nuts/O2NaRAH94GI/eXrvZtsTCQAJ | |
package days | |
import ( | |
"fmt" | |
"time" | |
) | |
func lastDayOfYear(t time.Time) time.Time { | |
return time.Date(t.Year(), 12, 31, 0, 0, 0, 0, t.Location()) |
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
func TimeCost(f func()) time.Duration { | |
start := time.Now() | |
f() | |
return time.Since(start) | |
} |
I hereby claim:
- I am jostyee on github.
- I am yee (https://keybase.io/yee) on keybase.
- I have a public key whose fingerprint is 159A 8301 DD6F 2626 F1BF 2458 31D7 8432 F47D 4399
To claim this, I am signing this object: