Skip to content

Instantly share code, notes, and snippets.


Fabio Neves fzero

View GitHub Profile
fzero /
Created Jul 15, 2011
A quick automatic tagger for MP3 (uses eyeD3 -
# This expects files ordered like:
# Artist/Album/01 Track Title.mp3
# You should provide the dir containing the Artist dirs at the command line.
if [ "$START" == "" ]; then
fzero /
Created Jul 15, 2011
Update several self-hosted Wordpress blogs at once on Dreamhost
cd $HOME
# Add here every domain/folder where you have Wordpress installed.
# Dreamhost normally puts all domains on $HOME, so this is what I do.
# Add here any dirs, file patterns etc. that you don't want to backup before upgrading.
# These are MY settings; tweak according to your needs.
rob0t7 /
Last active Nov 4, 2015
Javascript Closures

Javascript Closures, IIFE

Today we are going to look at some interesting features of the javascript language. Javascript is a prototype-based language with 1st class functions derived from scheme (and self) languages with a C like syntax.

What is a prototype-based language? It is a language of object-oriented programming in which behaviour (think inheritance) is performed by cloning existing objects (i.e. prototypes). It is also an

View TorqueBox on

With Heroku's JRuby support you may have already seen that you can run TorqueBox Lite on Heroku. But, that only gives you the web features of TorqueBox. What about scheduled jobs, backgroundable, messaging, services, and caching?

With a small amount of extra work, you can now run the full TorqueBox (minus STOMP support and clustering) on Heroku as well! I've successfully deployed several test applications, including the example Rails application from our Getting Started Guide which has a scheduled job, a service, and uses backgroundable and messaging.

This example uses TorqueBox 3.0.2, but the instructions may work with other TorqueBox versions.

Steps Required

  1. Create a JRuby application on Heroku, or convert an existing application to JRuby. Make sure your application works on JRuby on Heroku before throwing TorqueBox into the mix.
  2. Add th
FaisalAl-Tameemi /
Created Feb 3, 2016
W1D3 Lecture Notes - Arrays, Hashes, Scope

Data Structures


A way of storing lists in Ruby

names = ["Faisal", "Sara", "Jane"]
jonyt / connect_heroku_to_amazon_rds
Last active Apr 13, 2017
How to connect a Heroku application to an Amazon RDS Postgresql instance
View connect_heroku_to_amazon_rds
Download the certificate with:
`wget -O config/rds-combined-ca-bundle.pem`
Then connect with:
shuhei / _config.yml.diff
Created Apr 3, 2012
Add a category index to Octopress
View _config.yml.diff
diff --git a/_config.yml b/_config.yml
index 5c7d335..7ad03bb 100644
--- a/_config.yml
+++ b/_config.yml
@@ -45,7 +45,7 @@ titlecase: true # Converts page and post titles to titlecase
# list each of the sidebar modules you want to include, in the order you want them to appear.
# To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html'
-default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html]
+default_asides: [asides/recent_posts.html, custom/asides/categories.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.
kagemusha / gist:1569836
Created Jan 6, 2012
Dump Heroku Postgres DB and load locally
View gist:1569836
Get the Heroku db as detailed here:
1. heroku pgbackups:capture
2. heroku pgbackups:url <backup_num> #=>backup_url
- get backup_num with cmd "heroku pgbackups"
3. curl -o latest.dump <backup_url>
Then locally do:
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
fnhipster / html5.haml
Created Apr 9, 2011
HTML5 HAML Template
View html5.haml
!!! 5
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
velenux / rails-puma.service
Created Jun 3, 2015
systemd service to start rails/puma
View rails-puma.service
# based on
# create systemd service file for rails/puma startup
# 0. [if required: rvm use ruby@default]
# 1. rvm wrapper default systemd rails
# 2. put this file in /etc/systemd/system/rails-puma.service
# 3. systemctl enable rails-puma
# 4. systemctl start rails-puma
Description=Rails-Puma Webserver