Skip to content

Instantly share code, notes, and snippets.

View thexodus's full-sized avatar

Ashis Rai thexodus

  • Kathmandu, Nepal
View GitHub Profile
set :default_environment, {
'PATH' => "/home/deploy/.rvm/gems/ree-1.8.7-2010.02@pa/bin:/home/deploy/.rvm/gems/ree-1.8.7-2010.02@global/bin:/home/deploy/.rvm/rubies/ree-1.8.7-2010.02/bin:$PATH",
'RUBY_VERSION' => 'ree-1.8.7-2010.02',
'GEM_HOME' => '/home/deploy/.rvm/gems/ree-1.8.7-2010.02@pa',
'GEM_PATH' => '/home/deploy/.rvm/gems/ree-1.8.7-2010.02@pa:/home/deploy/.rvm/gems/ree-1.8.7-2010.02@global',
'BUNDLE_PATH' => '/home/deploy/.rvm/gems/ree-1.8.7-2010.02@pa' # If you are using bundler.
}
html, body{height:100%;}
.main-wrapper{min-height:100%;}
.footer-wrapper{height:120px;margin-top:-120px;}
# loading particular gemset
rvm ruby-1.8.7-p72@mbm
Regular Expression to remove all html tags except <p>
<(?!\/?p(?=>|\s.*>))\/?.*?>
@thexodus
thexodus / gist:760735
Created December 31, 2010 04:53
linecache in ruby-1.9.2-head
gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head/
@thexodus
thexodus / libxml2
Created March 7, 2011 10:00
libxml2 bug
1. libxml installed through brew
2. Error message
=================================================================================
HI. You're using libxml2 version 2.6.16 which is over 4 years old and has
plenty of bugs. We suggest that for maximum HTML/XML parsing pleasure, you
upgrade your version of libxml2 and re-install nokogiri. If you like using
libxml2 version 2.6.16, but don't like this warning, please define the constant
I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requring nokogiri.
=================================================================================
3. Solution
@thexodus
thexodus / gitpullerror
Created June 17, 2011 08:06
git:unable to add changes
➜ (ruby-1.9.2-p180@suga) sunago git:(three-oh) ✗ git pull --rebase
app/models/event.rb: needs update
app/views/checkin/_choose_event.html.erb: needs update
config/environment.rb: needs update
config/environments/development.rb: needs update
fatal: Unable to create '/Users/me/Dev/sunago/.git/index.lock': File exists.
@thexodus
thexodus / rvm.sh
Created July 19, 2012 18:07
/etc/profile.d/rvm.sh
#
# RVM profile
#
# /etc/profile.d/rvm.sh # sh extension required for loading.
#
if [ -n "${BASH_VERSION:-}" -o -n "${ZSH_VERSION:-}" ] ; then
# Load user rvmrc configurations, if exist
for file in /etc/rvmrc "$HOME/.rvmrc" ; do
[[ -s "$file" ]] && source $file
@thexodus
thexodus / fixes.md
Created August 9, 2012 11:27 — forked from zoras/fixes.md
Getting rid of nokogiri segfaults

This readme is a mixture of everything I read on SO+nokogiri wiki, which ultimately worked out for me.

Here are the steps which worked for me to get rid of segfaults with Nokogiri 1.4.4, on both Lion and Snow Leopard, with Ruby 1.8.7 (patchlevel 334 and +).

First diagnose which version of libxml2 you're using:

bundle exec nokogiri -v

If you have 2.7.3 listed somewhere, you're in bad waters (known to segfault). Install libxml2, libiconv, and libxslt after removing along with nokogiri:

@thexodus
thexodus / coffeescript_bundle_for_sublime.sh
Created September 27, 2012 05:50 — forked from zeke/coffeescript_bundle_for_sublime.sh
Install the CoffeeScript TextMate bundle in Sublime Text 2
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/CoffeeScript
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/CoffeeScript
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Syntaxes/CoffeeScript.tmLanguage
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Preferences/CoffeeScript.tmPreferences