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; | |
}; | |
}; |
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
# 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
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
#!/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
TextView tv = (TextView) findViewById(R.id.someTextView); | |
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/fontname.otf"); | |
tv.setTypeface(tf); |
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
const int main = 0xC3C031; |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
import json | |
import re | |
import sys | |
try: | |
import urllib.request as _urllib | |
except ImportError: |
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
#!/usr/bin/env bash | |
# | |
# Installation: | |
# Copy chmow to some directory in your path, like /usr/local/bin | |
# cd <directory_above> | |
# chmod 0755 chmow | |
# ln -s chmow chmod | |
# ln -s chmow chown | |
set -e -u |
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
import datetime | |
import json | |
import re | |
import sys | |
import urllib.request | |
video_id = sys.argv[1] | |
try: | |
start_offset = int(sys.argv[1]) | |
except (IndexError, ValueError): |
OlderNewer