Skip to content

Instantly share code, notes, and snippets.

View rmanalan's full-sized avatar
:octocat:

Rich Manalang rmanalan

:octocat:
View GitHub Profile
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias gb='git branch -a -v'
alias gs='git status'
alias gd='git diff'
alias gg='git gui &'
alias gl='git log --name-status'
[user]
email = @gmail.com
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
# Returns the distance SQL using the spherical world formula (Haversine). The SQL is tuned
# to the database in use.
def sphere_distance_sql(origin, units)
lat = deg2rad(origin.lat)
lng = deg2rad(origin.lng)
multiplier = units_sphere_multiplier(units)
case connection.adapter_name.downcase
when "mysql"
sql=<<-SQL_END
(ACOS(least(1,COS(#{lat})*COS(#{lng})*COS(RADIANS(#{qualified_lat_column_name}))*COS(RADIANS(#{qualified_lng_column_name}))+
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,perl,tex set shiftwidth=2
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth
export HISTSIZE=1000000
export HISTFILESIZE=1000000000
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias remote-print='ssh -L 9100:192.168.1.6:9100 root@manalang.dyndns.org'
# Courtesy of http://ozmm.org/posts/git_bash_aliases.html
alias gb='git branch -a -v'
alias gs='git status'
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias remote-print='ssh -L 9100:192.168.1.6:9100 root@manalang.dyndns.org'
# Courtesy of http://ozmm.org/posts/git_bash_aliases.html
alias gb='git branch -a -v'
alias gs='git status'
# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
# to create the application database on another system, you should be using db:schema:load, not running
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
set wildchar=<Tab> wildmenu wildmode=full
set wildcharm=<C-Z>
nnoremap ,, :b <C-Z>
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
class Object
def local_methods
(methods - Object.instance_methods).sort
end
end