Public Gists by tejo

Gravatar
Wed Oct 28 12:23:00 -0700 2009
1
2
3
# Para salvar a altura e largura das imagens enviadas pelo plugin paperclip, utilize o callback abaixo
#
# class Document < ActiveRecord::Base
Gravatar
Mon Oct 12 02:21:50 -0700 2009
1
2
3
module Sortable
  
  def self.included(base)
Gravatar
Mon Oct 12 02:15:45 -0700 2009
1
2
3
class ProductsController < InheritedResources::Base
  respond_to :html, :xml
  
Gravatar
Wed Sep 30 06:18:07 -0700 2009
1
2
3
class Deal
  include DataMapper::Resource
 
Gravatar
Sun Aug 23 04:07:58 -0700 2009
1
2
3
require 'rubygems'
require 'freedb_reader'
require 'rufus/tokyo'
Gravatar
Sun Aug 23 04:06:25 -0700 2009
1
2
3
require 'rubygems'
require 'mongomapper'
require 'freedb_reader'
Gravatar
Sun Aug 23 04:02:25 -0700 2009
1
2
3
{
   "artist": "Black Crowes, The",
   "title": "Shake Your Money Maker",
Gravatar
Sun Aug 23 03:40:56 -0700 2009
1
2
3
require 'rubygems'
require 'couchrest'
require 'freedb_reader'
Gravatar
Sun Aug 23 03:30:20 -0700 2009
1
2
3
require 'rubygems'
require 'couchrest'
require 'freedb_reader'
Gravatar
Sun Jul 26 23:53:51 -0700 2009
1
2
3
begin
  # check if memcached is running; if it is, use that instead of the default memory cache
  Timeout.timeout(0.5) { TCPSocket.open("localhost", 11211) { } }
Gravatar
Sat Jul 25 00:49:15 -0700 2009
1
2
3
# Monkey-patch for Passenger to use the EventMachine reactor.
# This allows the use of EM timers, EM.system/popen, and other async libraries (amqp, em-http-request, etc) inside a Rails process.
 
Gravatar
Sat Apr 25 23:54:29 -0700 2009
1
2
3
# Quick wrapper for undocumented and unsupported MyMileMarker.com API
 
require 'rubygems'
gist: 96971 passenger nginx
Gravatar
Fri Apr 17 04:02:09 -0700 2009
1
2
3
#!/bin/bash
# Unattended REE/Passenger installation with nginx
 
Gravatar
Tue Mar 03 01:49:42 -0800 2009
1
2
3
sudo bash -c "ARCHFLAGS='-arch i386' gem install mysql -- \
--with-mysql-config=/usr/local/mysql/bin/mysql_config"
 
Gravatar
Mon Mar 02 01:21:12 -0800 2009
1
2
3
$.getJSON("http://github.com/api/v1/json/tejo?callback=?", function(data){
    $('#loader').remove();
      $.each(data.user.repositories, function(i,repo){
Gravatar
Mon Mar 02 01:19:56 -0800 2009
1
2
3
$.getJSON("http://github.com/api/v1/json/tejo?callback=?", function(data){
    $('#loader').remove();
      $.each(data.user.repositories, function(i,repo){
Gravatar
Mon Mar 02 01:19:24 -0800 2009
1
2
3
$.getJSON("http://github.com/api/v1/json/tejo?callback=?", function(data){
    $('#loader').remove();
      $.each(data.user.repositories, function(i,repo){
Gravatar
Thu Feb 05 11:16:41 -0800 2009
1
2
3
var DateHelper = {
  // Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
  // Ruby strftime: %b %d, %Y %H:%M:%S GMT
Gravatar
Thu Feb 05 11:16:27 -0800 2009
1
2
3
var DateHelper = {
  // Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
  // Ruby strftime: %b %d, %Y %H:%M:%S GMT
Gravatar
Tue Nov 18 03:46:30 -0800 2008
1
2
3
def create
    @article = Article.new(params[:article])