Skip to content

Instantly share code, notes, and snippets.

def testing
if true == false
@post = Post.available
end
end
#
# Migration para criacao de users (model User)
#
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.timestamps
<html>
<head>
<title>Sendo feliz com o Active Scaffold</title>
<%= javascript_include_tag :defaults %>
<%= active_scaffold_includes %>
</head>
<body>
<%= yield %>
</body>
</html>
class UsersController < ApplicationController
active_scaffold :user
end
class User < ActiveRecord::Base
has_many :phones
end
class Phone < ActiveRecord::Base
belongs_to :user
end
class PhonesController < ApplicationController
active_scaffold :phone
end
osascript -e 'say "Dum la dum fa la la dum he dum dum fa dum dum la fa hoo hoo hoo dum dum lah fa he he he dum" using "Cellos"'
@elvio
elvio / ring.erl
Created April 23, 2013 15:28
Erlang Ring example
-module(ring).
-export([build/1, ring_node/2, loop/1]).
build(N) ->
Manager = self(),
register(ring, Manager),
Root = spawn(?MODULE, ring_node, [null, Manager]),
Root ! {create, N},
loop(N).
{
catchup: [
{
video_id: 68523,
time_starts_at: null,
time_ends_at: null,
title_en: "Das unsichtbare Mädchen",
title_de: "Das unsichtbare Mädchen",
genre_en: null,
genre_de: null
@elvio
elvio / bootstrap.sh
Last active December 19, 2015 12:39
Bootstrap Chef solo
#!/usr/bin/env bash
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev git
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
sudo ./configure --prefix=/usr/local
sudo make
sudo make install