Skip to content

Instantly share code, notes, and snippets.

View crossblaim's full-sized avatar

Claudio Perez Gamayo crossblaim

View GitHub Profile
Verifying that +claudio is my Bitcoin username. You can send me #bitcoin here: https://onename.io/claudio
@crossblaim
crossblaim / gist:1623116
Created January 16, 2012 21:24
process paperclip attachments in the background
# == Schema Information
# you need to add a flag to the model to indicate his processing status
# it defaults to true:
#
# attachment_processing :boolean(1) default(TRUE)
# ...
#
#----------------------------------------------------------------------
class Thing < ActiveRecord::Base
# Get the official Emacs repo:
git clone http://repo.or.cz/r/emacs.git/
# Get the fullscreen patch
git remote add typester git://github.com/typester/emacs.git
git fetch typester
# Create a patch and apply to HEAD
# I had merge conflicts when rebasing and
# build failures for origin/emacs-23
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "✘"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '
@crossblaim
crossblaim / test.sh
Last active October 18, 2018 15:45 — forked from wayneeseguin/gist:296055
This example shows how to setup an environment running Rails 3 beta under 1.9.1 with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell))
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.1
# Use the ruby + gem set
∴ rvm 1.9.1%rails3
# echowaves2.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
abstract -v1.0.0
actionmailer -v3.0.0.beta
actionpack -v3.0.0.beta
activemodel -v3.0.0.beta
activerecord -v3.0.0.beta
activeresource -v3.0.0.beta
activesupport -v3.0.0.beta
activesupport -v2.3.5
arel -v0.2.1
- simple
- public over private
- personal vanity
- internet is global
- permalinks
- one important item per page
- don't break the browser
- don't wanker in technology
- a medium is not a grande
- break convention for your users
@crossblaim
crossblaim / gist:80392
Created March 17, 2009 07:50
Workaround for safari never ending loading issue with Orbited
// Workaround for safari never ending loading issue with Orbited
var orig_chooseTransport = Orbited.util.chooseTransport;
Orbited.util.chooseTransport = function() {
if (BrowserDetect.browser == "Safari") {
// This will be the default transport in future versions of Orbited
return Orbited.CometTransports.LongPoll
}
return orig_chooseTransport();
}