Skip to content

Instantly share code, notes, and snippets.

View cleitonfco's full-sized avatar

Cleiton Francisco cleitonfco

View GitHub Profile
class Followings < ActiveRecord::Base
attr_accessible :user_id, :follower_id
belongs_to :user
belongs_to :follower, class_name: 'User'
belongs_to :following, class_name: 'User', foreign_key: :user_id
validates_uniqueness_of :user_id, scope: :follower_id
end

AbrilPro Ruby

SOA from the Start - Workshop Part


What will we show

We are building a set of applications that have will show deals (aka. 'inventory items') available in or near a given city. These items can also be organized by a 'category' (aka. tags), to cater to the various customers' areas of interest.

To bootstrap things, and to get us focussed on some key areas of developing in a SOA, we have gone ahead and built these apps out at varying stages. The workshops will focus on showing some of this code, and intersperse exercises to add features, or to refactor.

<label for="timezone">Timezone</label>
<select name="timezone" id="timezone">
<optgroup label="Africa">
<option value="Africa/Abidjan" label="Abidjan">Abidjan</option>
<option value="Africa/Accra" label="Accra">Accra</option>
<option value="Africa/Addis_Ababa" label="Addis Ababa">Addis Ababa</option>
<option value="Africa/Algiers" label="Algiers">Algiers</option>
<option value="Africa/Asmara" label="Asmara">Asmara</option>
<option value="Africa/Asmera" label="Asmera">Asmera</option>
<option value="Africa/Bamako" label="Bamako">Bamako</option>
--colour
--format specdoc
require 'rubygems'
require 'twitter'
class MyMiddleware
def initialize(app, config = {})
@app = app
@config = { :app => 'myapp' }.merge(config)
end
def call(env)
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
@cleitonfco
cleitonfco / change_pass
Created November 26, 2010 18:44
Scripts usados para criar um subdomínio com usuário novo no Linux
#!/usr/bin/expect -f
# Password change shell script, tested on Linux and FreeBSD
# ----------------------------------
# Copyright (c) 2006 nixCraft project
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
# display usage
# routes.rb
match "/admin/by_mark/:id" => "admin/models#by_mark", :as => "by_mark"
# view
<script>
$(function(){
$("#mark").change(function(){
load_model($(this).val());
@cleitonfco
cleitonfco / dabblet.css
Created April 13, 2012 09:07
Border-radius (curso HTML5 e CSS3)
/**
* Border-radius (curso HTML5 e CSS3)
*/
p {
font-family:Helvetica Neue, sans-serif;
font-size:30px;
padding:30px;
background-color:#905;
color:#fff;
width:90px;
@cleitonfco
cleitonfco / dabblet.css
Created April 13, 2012 13:48
Button CSS
/**
* Button CSS
*/
.user-register input[type="submit"] {
border: none;
color: #FFFFFF;
font-size: 15px;
height: 35px;
margin: 0 0 20px;