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
package controllers | |
import ( | |
"encoding/gob" | |
"fmt" | |
"github.com/robfig/revel" | |
"github.com/robfig/revel/cache" | |
"os" | |
"path/filepath" | |
"time" |
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
// http://play.golang.org/p/kmXecwWIMR | |
package main | |
import "fmt" | |
/* | |
Output: | |
Hello, playground | |
A: 1 |
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
JSON = {} | |
function JSON:new (o) | |
o = o or {} | |
setmetatable(o, self) | |
self.__index = self | |
return o | |
end | |
function JSON:stringify(depthLimit, depth) |
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
# Primary sources | |
# Install Grub2: http://community.linuxmint.com/tutorial/view/245 | |
# Update grub2: http://askubuntu.com/questions/145241/how-do-i-run-update-grub-from-a-livecd | |
# Run LiveUSB in live or persistent mode. You'll need the terminal after installation. | |
# Install as normal. You'll get an error about not being able to install the bootloader, ignore and continue, do not reboot. | |
# If you do reboot, just get back into live mode and continue. | |
# Replace the drive/partition numbers where necessary in the code below and run the following commands to install/update GRUB2 | |
#sudo mount /dev/sdXY /mnt |
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 | |
# Check that we are in a git repository. Will help avoid reckless recursion through files. | |
git_dir=$(git rev-parse --show-toplevel) && is_git_dir=1 | |
[ -z $is_git_dir ] && { | |
echo "Must execute inside a git repository" | |
exit | |
} | |
echo "Git repository: $git_dir" |
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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"io" | |
"io/ioutil" | |
"os" | |
) |
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
package main | |
import ( | |
"sync" | |
"fmt" | |
) | |
func main() { | |
defer func() { | |
fmt.Println("If you see this then success!") |
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 | |
set -eou pipefail | |
PORT=${1} | |
# Could use UDP here | |
lsof -iTCP:${PORT} | grep ${PORT} | tr -s ' ' | cut -d' ' -f2 |
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 | |
set -euo pipefail | |
TARGET=${1:-.} | |
if [ -d "$TARGET" ]; then | |
ls -al --color=yes "$TARGET" | |
elif [ -f "$TARGET" ]; then | |
less "$TARGET" | |
else |
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 | |
# Based on https://github.com/kubernetes/minikube/blob/master/docs/contributors/build_guide.md | |
# Eventually this should go into a formula to set up dependencies. | |
set -euo pipefail | |
MINIKUBE_REPO="https://github.com/kubernetes/minikube.git" | |
MINIKUBE_HASH=${1:-} | |
[ -z "$MINIKUBE_HASH" ] && { | |
git ls-remote --tags "$MINIKUBE_REPO" | sort -k2 -V | |
>&2 echo "Please select a hash to build: $0 <hash>" |
OlderNewer