Skip to content

Instantly share code, notes, and snippets.

View changemewtf's full-sized avatar

Max C changemewtf

View GitHub Profile
@changemewtf
changemewtf / portable_nosvn_grep.sh
Created September 10, 2010 16:27
This portable function will detect which svn-excluding find capabilities your shell has and act accordingly. 3 hours of my life that I can never get back.
function sgrep {
ARGS_WITH_OPTS=2
FILE_LIST_NO_BINARIES="-Il"
DEFAULT_OPTS_WITH_FIND="-hn"
DEFAULT_OPTS_WITHOUT_FIND="-rn"
SKIP_DIRS_RAW='svn'
SKIP_EXTS_RAW='pyc pyo so o a tgz'
SKIP_FILES_RAW='tags'
@changemewtf
changemewtf / bashrc_256color.sh
Created October 20, 2010 17:26
Sets your $TERM to 256color if the termcap entry exists. Particularly useful for gnome-terminal, which has no option to set $TERM.
case "$TERM" in
*-256color)
alias ssh='TERM=${TERM%-256color} ssh'
;;
*)
POTENTIAL_TERM=$TERM-256color
POTENTIAL_TERMINFO=${TERM:0:1}/$POTENTIAL_TERM
BOX_TERMINFO_DIR=/usr/share/terminfo
[[ -f $BOX_TERMINFO_DIR/$POTENTIAL_TERMINFO ]] && export TERM=$POTENTIAL_TERM
@changemewtf
changemewtf / gist:653824
Created October 29, 2010 16:12
Installing Qt bindings on an rvm-controlled ruby
# Ubuntu 10.04
# rvm 1.0.14
sudo aptitude install libqt4-core libqt4-dev cmake automoc
# from http://rubyforge.org/projects/korundum/
wget http://rubyforge.org/frs/download.php/71843/qt4-qtruby-2.1.0.tar.gz
tar -xvzf qt4-qtruby-2.1.0.tar.gz
cd qt4-qtruby-2.1.0
# the qtruby install uses the location of your ruby binary
rvm use 1.8.7
cmake .
@changemewtf
changemewtf / vim-html5tags.diff
Created September 30, 2011 20:46
Add new HTML5 tags to vim indent & syntax files.
diff -r ba9f075a347d runtime/indent/html.vim
--- a/runtime/indent/html.vim Sun Aug 28 16:02:28 2011 +0200
+++ b/runtime/indent/html.vim Sun Aug 28 11:57:32 2011 -0400
@@ -76,7 +76,6 @@
call <SID>HtmlIndentPush('object')
call <SID>HtmlIndentPush('ol')
call <SID>HtmlIndentPush('optgroup')
-" call <SID>HtmlIndentPush('pre')
call <SID>HtmlIndentPush('q')
call <SID>HtmlIndentPush('s')
void draw_tiles(char **tiles) {
int real_x, real_y;
Sprite *grass = get_sprite(GRASS_SPRITE);
for (int y = 0; y < TILEMAP_LENGTH; y++) {
for (int x = 0; x < TILEMAP_WIDTH; x++) {
grass->frames = grass_frames;
if (tiles[y][x] == 'G') {
real_x = (x * TILE_WIDTH) + ((TILEMAP_LENGTH - 1 - y) * TILE_LENGTH) + TILEMAP_X_OFFSET;
real_y = (y * TILE_LENGTH) + TILEMAP_Y_OFFSET;
<td valign="top">
20.
</td>,.
<td valign="top" width="40%">
BARTRUG, JOHN JEREMIAH
<br /> HOHENWALD, TN 38462
<br />
<br />
<strong> Profession:</strong> Nurse Aide
<br />
void TestReceives(CuTest *tc) {
struct sockaddr_in serv_port, cli_port, dest, from;
int server, client;
char recv_buffer[255];
int sent_bytes, received_bytes;
socklen_t from_size;
server = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (server <= 0) { fprintf(stderr, "no server\n"); exit(1); }
serv_port.sin_family = AF_INET;

Installing Tools

  1. Install [HipChat][hipchat]
  • [Upgrade to OS X Mavericks][osx]
  • Install [Google Chrome][chrome]
  • Check to make sure you don't have RVM or Macports by running this command from your terminal
    • bash <(curl -s https://gist.github.com/phlco/8358292/raw/b6e4df4efc7b7973cb5566e89c57672380062074/uninstalls.sh)ds
  • [Install Homebrew][brew] (The command is at the bottom of the page) * Type: brew doctor and resolve any warnings or errors that come up before moving on.
    • Then: brew install git rbenv ruby-build rbenv-gem-rehash postgres

Installing Tools

  1. Install [HipChat][hipchat]
  • [Upgrade to OS X Mavericks][osx]
  • Install [Google Chrome][chrome]
  • Check to make sure you don't have RVM or Macports by running this command from your terminal
    • bash <(curl -s https://gist.github.com/phlco/8358292/raw/b6e4df4efc7b7973cb5566e89c57672380062074/uninstalls.sh)ds
  • [Install Homebrew][brew] (The command is at the bottom of the page) * Type: brew doctor and resolve any warnings or errors that come up before moving on.
    • Then: brew install git rbenv ruby-build rbenv-gem-rehash postgres
export STUDENTS="$HOME/src/GA/Students"
export SFORK="$HOME/src/GA/Students-Fork"
export TENDER="$HOME/src/GA/Instructors"
function day_of_week_number {
day_of_week=$(date "+%A")
case $day_of_week in
"Monday") num='01';;
"Tuesday") num='02';;
"Wednesday") num='03';;