Moved to the scripts repository
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
PIPE=$(mktemp -d -t pipe.XXXXXX) && mkfifo $PIPE/pipe && exec 3<> $PIPE/pipe && rm -rf $PIPE | |
OUTPUTTER &>&3 & # substitute OUTPUTTER for the command whose output should be awaited | |
LOG_PID=$! | |
grep -m1 "$1" <&3 | |
kill -SIGTERM $LOG_PID | |
exec 3<&- #close our pipe |
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
SHELL = /bin/sh | |
PKGS := $(shell go list ./... | grep -v /vendor/) | |
CMDS := $(notdir $(shell go list -f '{{if eq .Name "main"}}{{.ImportPath}}{{end}}' ./cmd/...)) | |
GO_FILES := $(shell go list -f '{{$$dir := .Dir}}{{range .GoFiles}}{{print $$dir "/" . "\n"}}{{end}}{{range .TestGoFiles}}{{print $$dir "/" . "\n"}}{{end}}' ./... | grep -v /vendor/) | |
GO_VENDOR_FILES := $(shell go list -f '{{$$dir := .Dir}}{{range .GoFiles}}{{print $$dir "/" . "\n"}}{{end}}' ./vendor/...) | |
WORK := $(shell mktemp -d) | |
CMD_ROOT := __MY_PROJECT__ | |
go_cmd_deps = $(shell go list -f '{{$$dir := .Dir}}{{range .GoFiles}}{{print $$dir "/" . "\n"}}{{end}}' ./cmd/$(1)) $(shell go list -f '{{join .Deps "\n"}}' ./cmd/$(1) | grep -E '^$(CMD_ROOT)(/.*)?$$' | xargs go list -f '{{$$dir := .Dir}}{{range .GoFiles}}{{print $$dir "/" . "\n"}}{{end}}') | |
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
#cloud-config | |
hostname: core0 | |
ssh_authorized _keys: | |
- ssh-rsa AAAAB3NzaC1yc2... | |
coreos: | |
etcd: | |
# generate a new token for each unique cluster from https://discovery.etcd.io/new | |
name: core0 | |
discovery: https://discovery.etcd.io/dead0b52c8704ad95ac9681b4550247e |
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 | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
to recover files that were added to the index but whose changes were lost (e.g. git reset --hard
)
git fsck --unreachable | grep commit | cut -d\ -f3 | xargs git show
git fsck --unreachable
to get all the items that are unreachablegrep commit
to filter out all entries except for commits (the index will show up as a commit)cut -d\ -f3
to filter out all but the SHA1sxargs git show
to show all of the contents of the objects.
Once you've identified the SHA1 that contains the changes that were lost, check it out to get the working tree back into the state of the index at the time git reset --hard
was run.
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
exec: | |
run_server_tests: | |
command: () -> | |
path = require 'path' | |
testCommand = path.resolve 'path', 'to', 'something' | |
testCommandArgs = [] | |
testCommandArgs.push 'arg1' | |
testCommandArgs.push 'arg2' | |
testCommandArgs.push 'arg3' | |
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 | |
ROOTDIR=/media/storage/sounds | |
pushd "${ROOTDIR}" | |
grep -v '^#' music/Checked.m3u | sed -e 's./Volumes/storage/sounds/..' | \ | |
while read TRACK | |
do | |
if [ -e "${TRACK}" ] | |
then |
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
# tlInPlaceEdit controls toggling between a view mode and an edit mode by specifying an edit and a view template. | |
# | |
# Before using the tlInPlaceEdit directive, consider whether it would be better to use proper routing to control the client | |
# | |
# <tl-in-place-edit success-event-object="object" success-event-key="interpolated string" success-event="event that is raised when save succeeds"> | |
# <editor></editor> | |
# <view></view> | |
# </tl-in-place-editor> | |
# tl-in-place-edit@successEvent = The name of the event to which an event listener will be hooked up to switch | |
# back to view mode after the submit method succeeds. |
NewerOlder