Skip to content

Instantly share code, notes, and snippets.

Tony Pitale tpitale

Block or report user

Report or block tpitale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View trello-cards-from-csv.rb
#!/usr/bin/env ruby
require 'trello' # ruby-trello gem
require 'csv'
# export TRELLO_DEVELOPER_PUBLIC_KEY=yourkeyfrom #
# export BOARD_NAME=nameofboardtoimportto
# export MEMBER_NAME=yourusername
tpitale /
Last active Dec 19, 2015 — forked from bkenny/
Simple shell script to backup each postgresql database to s3.
DATE=`date +"%Y-%m-%d"`
if [ ! -d $DIR ];
mkdir -p $DIR
tpitale / lib-sunspot-data_mapper.rb
Created Oct 16, 2011 — forked from dkubb/dm_sunspot.rb
DataMapper and Sunspot Integration Extension
View lib-sunspot-data_mapper.rb
module Sunspot
module DataMapper
def self.included(base)
base.class_eval do
alias new_record? new?
base.extend Sunspot::Rails::Searchable::ActsAsMethods
Sunspot::Adapters::DataAccessor.register(DataAccessor, base)
View gist:660264
ruby-1.8.7-p299 > class Vehicle
ruby-1.8.7-p299 ?> include Mongoid::Document
ruby-1.8.7-p299 ?> field :horsepower
ruby-1.8.7-p299 ?> field :top_speed_mph
ruby-1.8.7-p299 ?> end
=> nil
ruby-1.8.7-p299 > => 300, :top_speed_mph => 180).save
=> true
View redis_pubsub_demo.rb
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
# Usage:
# ruby redis_pubsub_demo.rb
View tpitale_rails_template.rb
# tpitale_rails_template.rb
file 'config/routes.rb', <<-CODE
ActionController::Routing::Routes.draw do |map|
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/favicon.ico"
View gist:151540
cookies = document.cookie.split(';');
utmz = "";
for(i in cookies) {
if(cookies[i].test(/^__utmz/)) utmz = cookies[i];
medium = utmz.match(/".*?utmcmd=([a-z]+)\|/)[1];
adwords = utmz.match(/.*?utmgclid=([_0-9A-Za-z]+)\|/)[1];
View gist:114964
class GameMode
include DataMapper::Resource
property :id, Serial
property :title, String
property :description, Text
property :max_players, Integer
has n :games, :through => Resource
has n, :types, :through => Resource
View gist:114857
#!/usr/bin/env ruby
# A one file test to show ...
require 'rubygems'
require 'dm-core'
# setup the logger, :debug)
You can’t perform that action at this time.