Skip to content

Instantly share code, notes, and snippets.

@jparbros
jparbros / application_controller.rb
Created April 12, 2012 16:48
omniture_common_params refactor #3
class ApplicationController < ActionController::Base
end
@jparbros
jparbros / _social.html.haml
Created April 25, 2012 22:08
twitter plugin
%script
new TWTR.Widget({
version: 2,
type: 'search',
rpp: 30,
search: 'magmarails',
interval: 6000,
title: '#magmarails',
subject: '',
width: 700,
@jparbros
jparbros / gist:2911812
Created June 11, 2012 18:37
infraestructura
[6/11/12 12:59:56 PM] Basilio Briceño: si, la otra cosa que personalmente quiero ver contigo
[6/11/12 1:00:01 PM] Basilio Briceño: es la parte de la infraestructura
[6/11/12 1:00:44 PM] Basilio Briceño: como sabes, hay intereses a los que les vendria muy bien que el servicio se cayera
[6/11/12 1:01:19 PM] Basilio Briceño: por lo que me gustaria ver contigo el armar una infraestructura distribuida
[6/11/12 1:01:35 PM] Basilio Briceño: para evitar cualquier problema que nos pudiera ocasionar downtime
[6/11/12 1:01:57 PM] Jorge Pardiñas: la infraestrucutra la he estado pensando en el cloud services de heroku
[6/11/12 1:02:23 PM] Basilio Briceño: mmhm, quiza pueda conseguir mas servidores
[6/11/12 1:02:39 PM] Basilio Briceño: con buenos sysadmins detras
[6/11/12 1:02:56 PM] Basilio Briceño: que colaboren en mantener el uptime
[6/11/12 1:03:09 PM] Jorge Pardiñas: el poblema que le veo seria el tiempo de escalabilidad
@jparbros
jparbros / answer.rb
Created June 12, 2012 13:36
Voting system extracted a library
class Answer < ActiveRecord::Base
include Votes
act_as_votes
end
@jparbros
jparbros / gist:2967620
Created June 21, 2012 18:30
modals.js
Namespace('window.core.modals');
(function($, self) {
self.extend({
initialize: function() {
bindCloseButton();
bindEscapeButton();
bindResizeEvent();
@jparbros
jparbros / gist:3371170
Created August 16, 2012 15:41
file_reader.js
function handleFileSelect(evt) {
var files = evt.target.files; // FileList object
window.fileContent = evt.target.result;
// files is a FileList of File objects. List some properties.
var output = [];
var contents = e.target.result;
for (var i = 0, f; f = files[i]; i++) {
output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',
class Product < ActiveRecord::Base
attr_accessible :name, :qty
has_many :product_sales
end
class Sale < ActiveRecord::Base
belongs_to :salesman
has_many :product_sales
end
@jparbros
jparbros / scroll-down.js
Created October 24, 2012 23:43
scroll down infinito
scrollInfinite = {
initialize: function() {
_this = this;
this.template = _.template($('#artwork-template').html());
this.$container = $('#products-list');
this.spinner = $($('#spinner-template').html());
this.page = 2;
this.scrollAjaxStarted = false;
this.bottomOfPage = false;
this.onScroll();
@jparbros
jparbros / gist:5514505
Created May 3, 2013 21:54
Versiones gemas hallist
Gems included by the bundle:
* Ascii85 (1.0.2)
* actionmailer (3.2.8)
* actionpack (3.2.8)
* active_utils (1.0.5)
* activemerchant (1.28.0)
* activemodel (3.2.8)
* activerecord (3.2.8)
* activeresource (3.2.8)
* activesupport (3.2.8)
# == Schema Info
#
# Table name: comments
#
# id :integer
# author :string
# email :string
# comment :text
# post_id :integer
# created_at :datetime