Skip to content

Instantly share code, notes, and snippets.

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!
require "fileutils"
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "compiled"))
ActionController::Dispatcher.middleware.use(Rack::Static, :root => "tmp/", :urls => ["/stylesheets/compiled"])
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'
@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
@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.

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>

Keybase proof

I hereby claim:

  • I am glennr on github.
  • I am glennrob (https://keybase.io/glennrob) on keybase.
  • I have a public key whose fingerprint is D2C0 4AD2 276E C6CC 6F1C 91BC C7D7 09B8 D688 8ACA

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am glennr on github.
* I am glennrob (https://keybase.io/glennrob) on keybase.
* I have a public key whose fingerprint is A116 1BB1 8A55 FED3 0991 44D9 97CD 22CC C005 CD65
To claim this, I am signing this object:
@glennr
glennr / .eslintrc
Created November 19, 2015 06:19
ESLint config for React + Redux projects
{
"parser": "babel-eslint", // I want to use babel-eslint for parsing!
"rules": {
"comma-dangle": 0, // dangling commas are ok
"indent": [2, 2, {
"SwitchCase": 1
}],
"jsx-quotes": 1,
"linebreak-style": [2, "unix"],
"quotes": [2, "single"],
$(document).ready(function() {
$('#contact').submit(function(e) {
var form = $(this);
var endpoint = form.prop('action');
var data = form.serialize();
var submitButton = $('button', form);
e.preventDefault();
$.ajax({