Skip to content

Instantly share code, notes, and snippets.

:bowtie:
Focusing on @planetargon at the moment

Robby Russell robbyrussell

:bowtie:
Focusing on @planetargon at the moment
View GitHub Profile
View gist:2186
require "shorturl"
# rubyurl
url = ShortURL.shorten( 'http://mypage.com' )
# moourl
moo_url = ShortURL.shorten( 'http://mypage.com', :moourl )
View gist:2219
# Required for using Mongrel with Capistrano2
# gem install palmtree
require 'palmtree/recipes/mongrel_cluster'
########################################################################
# Rails Boxcar - Capistrano Deployment Recipe
# Configuration
########################################################################
# What is the name of your application? (no spaces)
View gist:5085
~ : irb
2 + 3>> 2 + 3
=> 5
>> x = 4
=> 4
>> x + 2
=> 6
>> x * 3
=> 12
>> x / 2
View gist:7355
~ : cat .gitconfig
[user]
email = robby@planetargon.com
name = Robby Russell
[alias]
co = checkout
ci = commit
st = status
br = branch
View .gitconfig
[user]
email = robby@planetargon.com
name = Robby Russell
[alias]
co = checkout
ci = commit
st = status
br = branch
mg = merge
@robbyrussell
robbyrussell / export.rake
Created Aug 31, 2008
rake task and library extension for ActiveRecord to export a model's records to a CSV file
View export.rake
namespace :export do
desc "Export ActiveRecord model records to a CSV file. Pass model name: model=ModelName"
task :to_csv => :environment do
require 'exportable'
open(RAILS_ROOT + '/log/export.pid', "w") do |file|
file << Process.pid
end
View request.xml
POST http://rubyurl.com/api/links
<link>
<website_url>http://github.com/robbyrussell</website_url>
</link>
View rubyurl-response.xml
<?xml version="1.0" encoding="UTF-8"?>
<link>
<website_url>http://github.com/robbyrussell</website_url>
<permalink>http://rubyurl.com/PNsF</permalink>
</link>
@robbyrussell
robbyrussell / rubyurl-request.json
Created Sep 2, 2008
request/response for RubyURL via JSON
View rubyurl-request.json
{ "link": { "website_url": "http://github.com/robbyrussell/rubyurl" } }
View rubyurl-httparty.rb
require 'rubygems'
require 'httparty'
class Rubyurl
include HTTParty
base_uri 'rubyurl.com'
def self.shorten( website_url )
post( '/api/links.json', :query => { :link => { :website_url => website_url } } )
end
You can’t perform that action at this time.