Skip to content

Instantly share code, notes, and snippets.

View nsanta's full-sized avatar

Nicolas Santa nsanta

  • Rio Cuarto, Cordoba, Argentina
View GitHub Profile
@nsanta
nsanta / r4c
Created November 19, 2014 00:39
R4C Developer Meeting R1.0
Motivo:
La idea es concisa:
Invitar a desarrolladores de Rio Cuarto y otros lugares
para juntarnos, aprender algo y de paso socializar. Se van a proponer charlas,
workshops, rants, etc. El tiempo es de 2 o 3 horas: 90 minutos de charlas, 90 de
socializar, hacking, etc.
@nsanta
nsanta / deloy.rb
Created October 25, 2014 02:13
deloy.rb
task :logs do
on roles(:app) do
# Establish link to database before running asset precompile
execute :tail, '-f', "#{current_path}/log/#{fetch(:stage)}.log"
end
end
{"results":[{"id":"OEKHewM","name":"","image":"http://assets.p.rs.mystorey.com/uploads/social/large_square_8ee7e37e10d4595150a02a2007289537.jpg","thumb":"http://assets.p.rs.mystorey.com/uploads/social/square_8ee7e37e10d4595150a02a2007289537.jpg","user":"Zubin Mowlavi","slug":"zubin-mowlavi","blurb":"Great night out with friends and family.","places":[],"people":[],"things":[{"id":2725,"uuid":"472db705f5b1bc2bd58b0158f73d5682","name":"Kid Dangerous Grime C...","price":"$36.00","brand":"Kid Dangerous","color":"ffffff","image":"http://assets.p.rs.mystorey.com/uploads/things/grid_8cac653e9bcbbd1b6e4a65d56533a52f.jpg","preview":"http://assets.p.rs.mystorey.com/uploads/things/preview_8cac653e9bcbbd1b6e4a65d56533a52f.jpg","thumb":"http://assets.p.rs.mystorey.com/uploads/things/thumb_8cac653e9bcbbd1b6e4a65d56533a52f.jpg","a_category":"Men's Tops","category":"Men's Tops","category_id":96,"url":"/products/472db705f5b1bc2bd58b0158f73d5682?experience_code=OEKHewM","type":"things","outbound":"http://api.viglink.com/api/cl
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
@nsanta
nsanta / five.rb
Created November 7, 2012 23:43
ActiveResource is dead, long live ActiveResource 5
class Weather < ActiveResource::Base
include ActiveResource::Singleton
self.site = 'http://37s.sunrise.i:3000'
end
@nsanta
nsanta / four.rb
Created November 7, 2012 23:41
ActiveResource is dead, long live ActiveResource 4
# GET /posts.json delivers following response body:
# {
# posts: [
# {
# title: "ActiveResource now has associations",
# body: "Lorem Ipsum"
# }
# {...}
# ]
# next_page: "/posts.json?page=2"
@nsanta
nsanta / three.rb
Created November 7, 2012 23:41
ActiveResource is dead, long live ActiveResource 3
class User < ActiveResource::Base
self.site = 'http://37s.sunrise.i:3000'
validates_presence_of :login, :email
before_validation :ensure_login_has_a_value
after_destroy :log_user_deletion
protected
def ensure_login_has_a_value
unless login
@nsanta
nsanta / two.rb
Created November 7, 2012 23:40
ActiveResource is dead, long live ActiveResource 2
class Comment < ActiveResource::Base
self.site = 'http://37s.sunrise.i:3000'
belongs_to :post
end
@nsanta
nsanta / one.rb
Created November 7, 2012 23:38
ActiveResource is dead, long live ActiveResource 1
class Post < ActiveResource::Base
self.site = 'http://37s.sunrise.i:3000'
has_many :comments
end
@nsanta
nsanta / four.coffee
Created November 2, 2012 00:11
angular timeline blog post gists four
app = angular.module(‘AwesomeApp’, [‘ngResource’]).
.config [‘$routeProvider’, ($route) →
$route.when(‘/sessions’, {
controller: ‘SessionCtrl’, # replace the controller function by the controller name
templateUrl: ‘/app/templates/sessions/login.html’
})