Skip to content

Instantly share code, notes, and snippets.

View kelsin's full-sized avatar

Christopher Giroir kelsin

View GitHub Profile
@kelsin
kelsin / ability.rb
Created August 10, 2011 16:54
CanCan rules in engines and main apps
# This is your main app/models/ability.rb file in your app
class Ability < Namespace::Ability
def initialize(user)
super
# Main app CanCan rules
end
end
@kelsin
kelsin / gist:1367092
Created November 15, 2011 13:39
Git home directory checkout
git init
git remote add origin git@github.com:Kelsin/configs.git
git fetch
git branch master origin/master
git checkout master
@kelsin
kelsin / gist:1374470
Created November 17, 2011 20:47
Javadoc-help Install
;; Javadoc Help
(autoload 'javadoc-lookup "javadoc-help" "Look up Java class in Javadoc." t)
(autoload 'javadoc-help "javadoc-help" "Open up the Javadoc-help menu." t)
(autoload 'javadoc-set-predefined-urls "javadoc-help" "Set pre-defined urls." t)
(global-set-key [f8] 'javadoc-lookup)
(global-set-key [(shift f8)] 'javadoc-help)
@kelsin
kelsin / new_server.py
Created December 24, 2011 03:01
Commands to get a murmur virtual server started up
import mice
# Show an array of all servers
mice.m.getAllServers()
# Create a new server
mice.m.newServer()
# Grab the new server object (for me this was server 2)
s2 = mice.m.getServer(2)
@kelsin
kelsin / emacs-fullscreen.sh
Created January 2, 2012 04:22
Installing patched emacs with fullscreen support from homebrew
cd /usr/local/Library/Formula
rm emacs.rb
wget https://raw.github.com/gist/1446720/36c7a3ab0ec8255e361dae11e0803cdf5cd09157/emacs.rb
brew install emacs --cocoa --lion
@kelsin
kelsin / find-lost-commits.sh
Created March 23, 2012 00:43
Finding lost commits
git fsck --full --no-reflogs | grep commit
@kelsin
kelsin / mysql.sql
Created July 14, 2012 21:41
Creating a new Mysql DB
-- First create the database
create database new_database;
-- Then give all privs to the correct user
grant all on new_database.* to username@localhost;
-- Or with privs written out
grant select, insert, update, delete, create, drop, references, index, alter, create temporary tables, lock tables, execute, create view, show view, create routine, alter routine on new_database.* to username@localhost;
@kelsin
kelsin / remote-vim.sh
Last active August 29, 2015 13:56
Vim remote editing alias
alias e='gvim --remote-silent'
@kelsin
kelsin / path.sh
Created February 18, 2014 07:13
Adding folders to PATH
# Path adding function
pathadd() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="$1:$PATH"
fi
}
export PATH
pathadd "/c/Program Files (x86)/Vim/vim74"
pathadd "$HOME/opt/ctags58"
@kelsin
kelsin / windows.vim
Created February 18, 2014 07:20
Letting windows vim use .vim instead of _vim
" Adding runtimepath for windows so we can use .vim instead of _vim
if !exists("g:loaded_runtime")
set runtimepath=~/.vim,$VIMRUNTIME
let g:loaded_runtime = 1
endif