Skip to content

Instantly share code, notes, and snippets.

@clooth
clooth / Git aliases
Created November 16, 2011 17:57
quick and simple git aliases
# Git
alias gs='git status'
alias go='git checkout'
alias gadd='git add -p'
alias gi='git commit'
alias gd='git diff'
alias gb='git branch'
alias gl='git log'
@clooth
clooth / gist:1436712
Created December 6, 2011 04:19
moonscript compilation helper
trap('INT') { exit } # graceful exit
ROOT = Dir.pwd
SRC = File.join(ROOT, 'src')
Dir.mkdir(SRC) unless File.directory?(SRC)
Dir.chdir(SRC)
loop do
Dir['**/*.moon'].each do |file|
@clooth
clooth / michaels_helper.rb
Created December 13, 2011 13:01
how about this
module ApplicationHelper
def markdown(text, *renderer)
case renderer[0]
props = {
hard_wrap: true,
gh_blockcode: true,
safe_links_only: true,
filter_html: true
}
when :authored
@clooth
clooth / rubythehardway.rb
Created December 14, 2011 10:25
Spider for Learn Ruby The Hard Way html book
#
# Learn Ruby The Hard Way
# =======================
# This tool will download you an offline
# single-page html version of the book
# =======================
# NOTE: This was only does to test how well it performs.
# You should read the book on the site:
# http://ruby.learncodethehardway.org/book/
#
@clooth
clooth / settings.rb
Created December 25, 2011 23:06
Channel specific Settings Plugin for Cinch
#
# Mirras Runescape IRC Bot
# Author: Clooth <[email protected]>
# Feature: Settings
#
require 'cinch/storage/yaml'
class Setting
@name = nil
@value = nil
[2011/12/26 01:05:32.411] !! /Users/Nico/.rvm/gems/ruby-1.9.3-p0@mirras/gems/cinch-2.0.0/lib/cinch/irc.rb:320:in `block in on_mode': uninitialized constant Cinch::IRC::UnsupportedFeature (NameError)
[2011/12/26 01:05:32.413] !! /Users/Nico/.rvm/gems/ruby-1.9.3-p0@mirras/gems/cinch-2.0.0/lib/cinch/irc.rb:286:in `each'
[2011/12/26 01:05:32.413] !! /Users/Nico/.rvm/gems/ruby-1.9.3-p0@mirras/gems/cinch-2.0.0/lib/cinch/irc.rb:286:in `on_mode'
[2011/12/26 01:05:32.413] !! /Users/Nico/.rvm/gems/ruby-1.9.3-p0@mirras/gems/cinch-2.0.0/lib/cinch/irc.rb:211:in `parse'
[2011/12/26 01:05:32.413] !! /Users/Nico/.rvm/gems/ruby-1.9.3-p0@mirras/gems/cinch-2.0.0/lib/cinch/irc.rb:112:in `block (2 levels) in start_reading_thread'
[2011/12/26 01:05:32.413] !! /Users/Nico/.rvm/gems/ruby-1.9.3-p0@mirras/gems/cinch-2.0.0/lib/cinch/helpers.rb:91:in `rescue_exception'
[2011/12/26 01:05:32.413] !! /Users/Nico/.rvm/gems/ruby-1.9.3-p0@mirras/gems/cinch-2.0.0/lib/cinch/irc.rb:110:in `block in start_reading_thread'
@clooth
clooth / invite_joiner.rb
Created December 26, 2011 02:18
Join a channel on invite with a twist, Cinch Plugin
#
# Mirras Runescape IRC Bot
# Author: Clooth <[email protected]>
# Feature: InviteJoiner
# Somewhat fun way to allow the bot to join channels on invite
#
class InviteJoiner
include Cinch::Plugin
include Authentication
@clooth
clooth / invite_joiner.rb
Created December 26, 2011 15:41
Cinch Plugin for joining on Invitation
#
# Mirras Runescape IRC Bot
# Author: Clooth <[email protected]>
# Feature: InviteJoiner
# Somewhat fun way to allow the bot to join channels on invite
#
class InviteJoiner
include Cinch::Plugin
include Authentication
#!/bin/bash
# Paths
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
VIRTUALENV_DIR="${DIR}/venv"
APPLICATION_DIR="${DIR}/Source/bender"
REQUIREMENTS_DIR="${APPLICATION_DIR}/requirements"
# Text formatting variables
UNDERLINE=$(tput sgr 0 1)
@clooth
clooth / .bash_profile
Created August 9, 2012 18:24
My .bash_profile
# Colors
declare -A Colors
Colors[black]="\[\033[0;30m\]"
Colors[red]="\[\033[0;31m\]"
Colors[green]="\[\033[0;32m\]"
Colors[yellow]="\[\033[0;33m\]"
Colors[blue]="\[\033[0;34m\]"
Colors[magenta]="\[\033[0;35m\]"
Colors[cyan]="\[\033[0;36m\]"
Colors[white]="\[\033[0;37m\]"