Skip to content

Instantly share code, notes, and snippets.

@grigio
grigio / gist:4040789
Created November 8, 2012 19:01 — forked from mperham/gist:1379464
Flexibility without Dependency Injection
class TaxCode
GENERATORS = {
:us => lambda { |id| "US-#{id}" },
:br => lambda { |id| "#{id + 9}-BRA" }
}
def self.generate(code, id)
gen = GENERATORS[code] || (raise ArgumentError "No generator for country #{code}")
gen.call(id)
end
@grigio
grigio / gist:4086113
Created November 16, 2012 10:04 — forked from drewfradette/gist:2617991
CodeCat - syntax highlighting for cat
#!/bin/bash
# Filename catc
# Description print files to stdout with syntax highlighting (using python-pygments)
# Author Drew Fradette <http://www.github.com/drewfradette>
# Version 0.6
# Last Updated 2012-09-26
# Usage catc file.sh
# bash_version 4.2.10(1)-release
#######################################################
@grigio
grigio / linux-tools.sh
Last active October 13, 2015 07:38
Linux Kickstart Tools
# essential
sudo apt-get install git-core sudo vim curl tree screen zsh smartmontools apparmor-utils xsel ssmtp mailutils
# cli
sudo apt-get install espeak ethtool powerwake sshfs
# gui
sudo apt-get install dconf-tools xbacklight

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

// Module pattern test
function show(string) {console.log(string);}
function MyMod (){
// constructor
var c = 0;
function priv(){

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@grigio
grigio / Gemfile
Created June 9, 2013 14:07
Minimal Sinatra app app.rb + config.ru + Gemfile for Openshift, test locally with "rackup"
source "https://rubygems.org"
gem 'sinatra'
@grigio
grigio / gist:5807500
Created June 18, 2013 17:30
meteor deploy - what is inside

Quale Linux?

Distributor ID:  Ubuntu
Description:	Ubuntu 12.10
Release:	12.10
Codename:	quantal

env

@grigio
grigio / Google-Reader-open-source-alternatives.md
Last active July 30, 2021 02:45
Google Reader open source alternatives & features

Here some Google Reader Open Source alternatives with the most expected features.

Please fork and help me to keep it updated.

Name language Database has categories Responsive/Mobile
Commafeed java hsql,mysql/postgresql
Freader nodejs mongodb ???
Goread go appengine
Miniflux php
@grigio
grigio / gist:6138263
Created August 2, 2013 08:13
Install phantomjs via bash, because a compatible deb or ppa for Ubuntu 12.04 are missing :(
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-i686.tar.bz2 # currently latest
tar xjf phantomjs-1.9.1-linux-i686.tar.bz2
cd /usr/local/share/
ln -s phantomjs-1.9.1-linux-i686 phantomjs
sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/bin/phantomjs