Public Gists by gary

Gravatar
Fri Sep 25 11:25:40 -0700 2009
1
2
>> OutgoingTextMessage.all(:client_id => 7).update!(:state => 'pending', :attempts => 0, :last_error => '')
 ~ (0.070989) UPDATE `outgoing_text_messages` SET `last_error` = '', `state` = 'pending', `attempts` = 0 WHERE (`client_id` = 7)
Gravatar
Thu Sep 24 12:14:18 -0700 2009
1
2
3
# -*- mode:ruby -*-
 
  #properties involved...
Gravatar
Wed Sep 02 08:13:36 -0700 2009
1
2
3
def blogs?(obj)
    return false if obj.nil?
 
Gravatar
Sat Aug 29 12:33:27 -0700 2009
1
2
3
<span class="photo">
  <img src="http://15.media.tumblr.com/tumblr_kp5jzgcVjb1qa1uj5o1_400.jpg"
       alt="QUERIA estar na praia certa nos dias certos."
Gravatar
Wed Aug 26 11:46:40 -0700 2009
1
2
3
require 'net/http'
require 'uri'
def untinyurl(tinyurl)
Gravatar
Tue Aug 04 13:36:10 -0700 2009
1
2
3
  task :load_raw_data => :merb_env do
    adapter = DataMapper.repository(:default).adapter
 
Gravatar
Thu Jun 25 07:55:47 -0700 2009
1
2
3
def killuser(phone_number='8084578872')
  u = User.first(:phone_number => phone_number)
  return nil unless u
Gravatar
Mon Apr 06 06:39:28 -0700 2009
1
2
3
#!/usr/bin/ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
Gravatar
Mon Mar 23 09:03:11 -0700 2009
1
2
3
    run "cd #{release_path}; \
for sass in app/views/sass/*.sass; \
base=`basename $sass`
Gravatar
Tue Mar 03 12:54:54 -0800 2009
1
2
3
class Carrier
  include DataMapper::Resource
 
Gravatar
Wed Feb 04 20:00:39 -0800 2009
1
2
3
# make life in JavaScript more readable by wrapping the Objects needed
    # to update after a {successful,failed} save in a named Hash, which will
    # serialize an Object with key-named properties. big slick.
Gravatar
Mon Jan 26 14:54:47 -0800 2009
1
2
3
    namespace(:mobile_edition, :name_prefix => 'topic', :namespace => 'topics') do
      match('/subscriptions/edit/:id').
        to(:controller => 'subscriptions', :action => :edit).
Gravatar
Tue Jan 20 09:30:26 -0800 2009
1
2
    = form_for @subscription, :action => url(:create_mobile_alert_subscription), :method => 'post' do
      = partial subscription_for_mobile_alert(@mobile_alert), :with => @subscription
Gravatar
Mon Dec 22 12:57:10 -0800 2008
1
2
3
[ebuild N ] dev-libs/apr-1.3.2 USE="-debug -doc -urandom"
[ebuild N ] app-misc/mime-types-7
[ebuild N ] app-admin/php-toolkit-1.0.1
Gravatar
Fri Dec 19 08:24:12 -0800 2008
1
2
3
namespace :db do
 
  desc "Bootstrap the application, readying it for use."
Gravatar
Thu Dec 18 12:27:12 -0800 2008
1
2
3
  match(:subdomain => /(\w+)/).to(:namespace => 'newspapers') do |sd|
    sd.match('/').to(:controller => ':subdomain[1]', :action => 'index')
  end
Gravatar
Thu Dec 18 12:03:14 -0800 2008
1
2
3
  match(:first_subdomain => ":subdomain").namespace('newspapers') do |sd|
    sd.match('/').to(:controller => :first_subdomain, :action => 'index')
 
Gravatar
Thu Dec 18 11:55:07 -0800 2008
1
;;; Key Bindings -----------------------------------------------------
Gravatar
Sat Nov 15 16:22:22 -0800 2008
1
2
3
# Git Sub-Trees Sake Tasks
# http://rubyurl.com/BwnY < - Read about the technique vs submodules
#
Gravatar
Tue Aug 26 09:58:37 -0700 2008
1
2
3
# by bryan helmkamp with slight modification by chris wanstrath
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow