Skip to content

Instantly share code, notes, and snippets.

@glennr
glennr / README.md
Created December 8, 2011 12:46 — forked from fnichol/README.md
Campfire script for Pomodoro

Description

Simple [Campfire][campfire_app] notifier for the [Pomodoro app][pomodoro_app], based off [xiplias][xiplias]'s [gist][parent_gist].

The script reads a JSON file to match a leading pomodoro tag with a Campfire account. In the example file there is a campfire account with tag called "wco". Any pomodoros starting with "wco-", "wco_", "wco," will use the "wco" campfire account. If no campfire account exists with the leading tag, nothing will be broadcast.

@glennr
glennr / vim-uber-glory
Created September 8, 2011 19:05
Uber-Glory for VIM
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
glenn-roberts-4 ~/code/google_analytics[json_fix]$ gh pull al2o3cr
*** Warning: There was a problem accessing the network.
/opt/local/lib/ruby/gems/1.8/gems/json_pure-1.4.3/lib/json/common.rb:146:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError)
from /opt/local/lib/ruby/gems/1.8/gems/json_pure-1.4.3/lib/json/common.rb:146:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/json_pure-1.4.3/lib/json/common.rb:146:in `parse'
from /opt/local/lib/ruby/gems/1.8/gems/github-0.4.3/lib/commands/helpers.rb:402:in `get_cache'
from /opt/local/lib/ruby/gems/1.8/gems/github-0.4.3/lib/commands/helpers.rb:339:in `get_network_data'
from /opt/local/lib/ruby/gems/1.8/gems/github-0.4.3/lib/commands/helpers.rb:326:in `network_members'
from /opt/local/lib/ruby/gems/1.8/gems/github-0.4.3/lib/commands/commands.rb:111:in `command'
from /opt/local/lib/ruby/gems/1.8/gems/github-0.4.3/bin/../lib/github/command.rb:25:in `send'
require "fileutils"
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "compiled"))
ActionController::Dispatcher.middleware.use(Rack::Static, :root => "tmp/", :urls => ["/stylesheets/compiled"])
require "fileutils"
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "compiled"))
ActionController::Dispatcher.middleware.use(Rack::Static, :root => "tmp/", :urls => ["/stylesheets/compiled"])
if Rails.env.to_sym == :development
require 'compass'
# If you have any compass plugins, require them here.
Compass.configuration.parse(File.join(RAILS_ROOT, "config", "compass.config"))
Compass.configuration.environment = RAILS_ENV.to_sym
Compass.configure_sass_plugin!
#! /bin/sh
find . -name \*.rb -type f | xargs grep -nHr "$1"
alias mbp='mate -w ~/.bash_profile && source ~/.bash_profile'
gem install glennr-devise
or
config.gem 'glennr-devise', :lib => 'devise', :source => 'http://gemcutter.org'
Devise.setup do |config|
...
config.mailer_content_type = 'text/plain'
class User < ActiveRecord::Base
devise :authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable