Skip to content

Instantly share code, notes, and snippets.

View xaviervia's full-sized avatar

Fernando Via Canel xaviervia

View GitHub Profile
@xaviervia
xaviervia / gist:3177392
Created July 25, 2012 17:25
Como hacer que un repo quede listo para Travis
Note to self: Pasos para que una gema tenga sentido meterla en Travis CI:
- Agregar
group :test do
gem "rake"
end
en el Gemfile
class Demonstration
# Description of the method
def the_method required_argument, optional_one = true
"Do something, not much"
end
end
@xaviervia
xaviervia / adf
Created August 8, 2012 10:05
History
# Hooks in DSL
En base a RCapture # NOT. Rcapture is poorly planned
trigger | hook
trigger | fire | filter
> hook | trap | lock
event | capture (formal)
@xaviervia
xaviervia / gist:3390651
Created August 19, 2012 00:54
Nice and short: how to redirect Port 4567 into 80 in Ubuntu
# Because you want to run Ruby as a regular user and not as root, don't you?
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4567
# Source: http://serverfault.com/questions/112795/how-can-i-run-a-server-on-linux-on-port-80-as-a-normal-user?answertab=votes#tab-top
@xaviervia
xaviervia / .bash_aliases
Created August 30, 2012 21:20
Shortcuts I use
# .bash_aliases
alias cuke="bundle exec cucumber -i"
alias spec="bundle exec rspec --color --format doc"
alias play="bundle exec piano"
@xaviervia
xaviervia / instructions.md
Created September 21, 2012 04:16
Ultra fast server setup with Node, CoffeeScript, Express and MongoDB

Minimal REST server with Node and MongoDB

  1. Install httpie
  2. Install node.js
  3. Paste those files into some folder
  4. Install CoffeeScript into node with npm install coffee
  5. Run the server coffee server.coffee

Use it

@xaviervia
xaviervia / jajaja.md
Created September 21, 2012 04:58
OMG

OMG

Ok, this is seriously awesome.

Complete out of the box restful server with CoffeeScript and MongoDB.

Can't describe my excitement

Just coffee rest.coffee

source :rubygems
gem 'mongo-fixture'
gem 'mongo'
gem 'bson_ext'
gem 'sinatra'
gem 'slim'
gem 'thor'