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 | |
if [ $# -ne 1 ]; then | |
echo "Usage: $(basename "${0}") <project>" | |
exit 1 | |
fi | |
mkdir -p "${1}"/{,src,pkg,bin} | |
cat << 'EOF' > "${1}/activate" |
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
export GOPATH="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)" | |
export OLDPS1=$PS1 | |
export PS1="[go:$(basename $GOPATH)] $PS1" | |
alias gcd="cd $GOPATH" | |
deactivate() { | |
export PS1=$OLDPS1 | |
unset GOPATH | |
unset OLDPS1 | |
unalias gcd | |
unset deactivate |
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
# OS X | |
.DS_Store | |
._* | |
.Spotlight-V100 | |
Icon? | |
.Trashes |
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
#define _x_segfault() \ | |
__asm__ __volatile__ ("movq $0, %%r11\n" \ | |
"movq (%%r11), %%r10\n" \ | |
: \ | |
: \ | |
: "%r11", "%r10" \ | |
) |
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
struct Pixel | |
{ | |
union | |
{ | |
struct { | |
uint8_t red, green, blue, alpha; | |
}; | |
uint32_t raw; | |
}; | |
}; |
NewerOlder