Skip to content

Instantly share code, notes, and snippets.

View t-mart's full-sized avatar

Tim Martin t-mart

View GitHub Profile
---------
function GoGo_OnLoad()
---------
SLASH_GOGOMOUNT1 = "/gogo"
SlashCmdList["GOGOMOUNT"] = function(msg) GoGo_OnSlash(msg) end
SLASH_GOGOID1 = "/id"
SlashCmdList["GOGOID"] = function(msg) GoGo_Msg(GoGo_Id(msg)) end
this:RegisterEvent("VARIABLES_LOADED")
#include <stdlib.h>
#include "grid.h"
#include "gbalib.h"
#include "game.h"
tile* tile_init(void){
tile* t = (tile*) malloc(sizeof(tile));
t->ge = CLEAR;
t->gep = NULL;
@t-mart
t-mart / zshrc
Created January 26, 2012 06:57
bad hook
#!/usr/bin/zsh
typeset -U fpath #make fpath unique
typeset -U path #make path unique
autoload -U colors && colors
autoload -Uz vcs_info
autoload -U tetris
autoload -U compinit
export EDITOR='vim' #set editor var, as well as zsh vi mode
@t-mart
t-mart / gist:2877186
Created June 5, 2012 19:27
shuffling
import java.util.Random;
public class Person2 {
/**
* This method should take the string
* input and return its characters in
* random order.
* given "gtg123b" it should return
* something like "g3tb1g2".
*
@t-mart
t-mart / gist:2919961
Created June 12, 2012 20:34
my thang
ERROR=-Wall -Werror -Wextra -pedantic
STANDARD=-std=c++0x
CC=g++
#implying this is where main is
OUTFILE=$(shell basename $(shell pwd))
BUILDFILES=$(shell ls -R | grep "\.cpp")
all: run
class AddDeviseLockableColumnsToUser < ActiveRecord::Migration
def change
change_table :users do |t|
t.lockable :maximum_attemps => 3, :lock_strategy => :failed_attempts, :unlock_strategy => :none
end
end
end
@t-mart
t-mart / fourget.sh
Created October 7, 2015 04:36
Download 4chan images to the current directory.
#!/usr/bin/env sh
# Download 4chan images to the current directory.
#
# example: fourget http://boards.4chan.org/int/thread/48964967
#
# requires httpie to be installed.
# The MIT License (MIT)
#
@t-mart
t-mart / rude.sh
Last active October 7, 2015 23:03
Say it with me: Random Uuids...R Uuid...Ruuid...rude!
#!/usr/bin/env python2
from base64 import b32encode
from uuid import uuid4
from sys import stdout
stdout.write(b32encode(uuid4().bytes)[:-6])
if stdout.isatty():
stdout.write('\n')
@t-mart
t-mart / git_aliases.txt
Created October 15, 2012 22:55
My git aliases
Status
gst='git status'
gss='git status -s'
gstv='git status -v'
Remotes
gp='git push'
gl='git pull'
glom='git pull origin master'
ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
@t-mart
t-mart / pull-submodules-to-origin-master.pre-commit-hook.sh
Last active October 15, 2015 04:27
A script to pull submodules to their origin/master. Meant to be used as a git hook.
#!/bin/sh
#
# To enable this hook, place this file at:
# <repo-base-dir>/.git/hooks/pre-commit
printf "Updating submodules to origin master..." >&2
git submodule update --rebase --remote
STATUS=$?
if [ $STATUS -eq 0 ]; then
echo "done" >&2