Skip to content

Instantly share code, notes, and snippets.

View olistik's full-sized avatar

Maurizio De Magnis olistik

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
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
@fin
fin / haml_watch.rb
Created July 17, 2011 23:02
haml directory watcher
#!/usr/bin/ruby1.8
# Script to watch a directory for any changes to a haml file
# and compile it.
#
# USAGE: ruby haml_watch.rb <directory_to_watch>
#
# Original by Blake Smith / http://blakesmith.github.com/2010/09/05/haml-directory-watcher.html
# Modifications by fin / http://fin.io
#
@olistik
olistik / gist:1398377
Created November 27, 2011 23:00
GIT <3
# source: http://goo.gl/BaVkQ
$ git log --name-status
# To delete a remote branch
$ git push origin :<branch_name>
@olistik
olistik / .gitconfig
Created January 27, 2012 14:16
My .gitconfig
[core]
editor = /Users/olistik/bin/subl
[user]
name = Maurizio De Magnis
email = maurizio.demagnis@gmail.com
[alias]
co = checkout
ci = commit
rb = rebase
st = status
@marcel
marcel / gist:2100703
Created March 19, 2012 07:24
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@olistik
olistik / gist:2292864
Created April 3, 2012 15:18
Removes active record from a Rails app
diff --git a/Gemfile b/Gemfile
index fd83475..a4c0255 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,7 +5,7 @@ gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem 'sqlite3'
+# gem 'sqlite3'
@olistik
olistik / gist:2627011
Last active August 12, 2021 06:39
Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git curl
  • Copy/paste from the command line:
@olistik
olistik / hera.rb
Created June 12, 2012 07:29
HEroku RAge: an application template to have instant gratification with both Rails and Heroku
# Usage:
# rails new <app_name> -d postgresql -m https://raw.github.com/gist/2915895/c13055a80c6747d4ad0ef5b650d04c5a99e31dfc/hera.rb
# cd <app_name>
# heroku open
git :init
git add: "."
git commit: "-a -m 'Genesis'"
insert_into_file 'Gemfile', "ruby '1.9.3'\n", after: "source 'https://rubygems.org'\n"
@sowawa
sowawa / sinachiku.rb
Created June 18, 2012 07:00 — forked from mattn/sinachiku.rb
sinatra on mruby
require 'HTTP'
require 'UV'
module Sinachiku
@routes = { 'GET' => [], 'POST' => [] }
def self.route(method, path, opts, &block)
@routes[method] << [path, opts, block]
end
def self.do(r)
@routes[r.method].each {|path|