Skip to content

Instantly share code, notes, and snippets.



OSX El Capitan 10.11.2

Using Homebrew LLVM v3.5.1 (formula homebrew/versions/llvm35)

tail configure.log

[2015-12-27 17:41:30] Checking for header 'openssl/ssl.h':
View rubyconf-notes
RAML API design
Monads and Ruby
Book: understanding computation, Tom Stuart
Seccasts screencasts:
Elixir Sips:
Coursera, Programming Languages:
Rblibeprof stack git

App to manage a blog.

The interface will be a JSON API. Please follow standard.

There are users, blog posts and comments. A user can own many blog posts, and a blog post can have many comments.

  • Users should be able to sign up, and log in.

  • POST /sign_up will receive an email and password params and will create a new User. The email param must be a valid email address and the password must be at least 8 chars long.

View mvc.php
// Model
class Province
public $name;
public $id;
public function __construct($name, $id) {
$this->name = $name;
$this->id = $id;

Uniform Access Principle

All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation

Bertrand Meyer

View create.js
* Creates a new object that uses the old object as its prototype
* From: Javascript: the Good Parts
if (typeof Object.create !== 'function') {
Object.create = function (o) {
var F = function () {};
F.prototype = o;
return new F();

FOR loops

  • Factorial: hacer una función que calcule el factorial de un número.
function factorial ($number) {
View active_record_example.rb
require "rubygems"
require "active_record"
#Change this to reflect your database settings
ActiveRecord::Base.establish_connection (
:adapter => "mysql",
:host => "localhost",
:username => "root",
:password => "password",
:database => "some_database")
View rodrei.zsh-theme
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%n:%~$(git_prompt_info)%{$fg_bold[green]%}%# %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"