Skip to content

Instantly share code, notes, and snippets.

@andersonsp
andersonsp / android_ics_tones.gpl
Created September 28, 2012 13:55
Gimp palette for Android ICS tones (including all 14 shades of each color as listed here http://developer.android.com/design/style/color.html)
GIMP Palette
Name: Android ICS
Columns: 8
#
51 181 229 33B5E5
170 102 204 AA66CC
153 204 0 99CC00
255 187 51 FFBB33
255 68 68 FF4444
0 153 204 0099CC
@andersonsp
andersonsp / git_svn_bash_prompt.sh
Created October 18, 2011 16:07 — forked from sammyd/git_svn_bash_prompt.sh
Set color bash prompt according to ruby version and git/svn branch, and return status of last command
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the ruby version
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
var Rufus = {
Mnemo: {
/** CONSTANTS **/
V: [ 'a', 'e', 'i', 'o', 'u' ],
C: [ 'b', 'd', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'r', 's', 't', 'z' ],
SYL: [], // This is populated later on. [1]
SPECIAL: [
@andersonsp
andersonsp / README
Created March 18, 2011 19:08
Rails 3 custom form builder implementing a simple color picker based on JQuery and CaryonBox plugin
INSTALLATION
the rails application must have support for JQuery
get JQuery.Crayonbox.js at http://gelform.com/crayonbox-jquery-plugin/
add the plugin JQuery.Crayonbox.js to /public/javascript folder
add the crayonbox css to /public/stylesheets folder
add color_picker_form_builder.rb to the /lib folder
add to the view or layout file:
@andersonsp
andersonsp / dup_mysql_db.sh
Created January 26, 2011 20:32
duplicate a mysql database
mysqladmin create DB_name -u DB_user --password=DB_pass && \
mysqldump -u DB_user --password=DB_pass DB_name | mysql -u DB_user --password=DB_pass -h DB_host DB_name
@andersonsp
andersonsp / setup_load_paths.rb
Created November 18, 2010 22:26
fork of the darcy's setup_load_paths.rb from http://bit.ly/rvm-passenger-slp
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
dir = File.dirname(File.dirname(__FILE__))
rvmrc = File.join(dir, ".rvmrc")
if File.exists? rvmrc