Skip to content

Instantly share code, notes, and snippets.

View tatiC's full-sized avatar

Tati Carvalho tatiC

  • Untried Possibilities
  • Brasil - Rio de Janeiro
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 14, 2024 19:27
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@craic
craic / meta_search_custom_column_sort.rb
Created June 10, 2011 17:53
This gist includes a Rails helper and controller code that lets you sort on custom columns alongside the meta-search gem search and sort features
# Helper method - place in application_helper.rb
def custom_sort_helper(path, sort_term, sort_label, search, sort_string)
uri = String.new(path)
# copy the current search terms but exclude meta_sort
search_array = Array.new
search.search_attributes.each { |key, val| (search_array << "search[#{key}]=#{val}") unless key == 'meta_sort' }
uri << '?'