Skip to content

Instantly share code, notes, and snippets.

View localredhead's full-sized avatar

Levi Strope localredhead

View GitHub Profile
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
puts message
image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
-------- request JSON ---------
"build": {
"monogram": {
"name": "Monogram",
"id": 33
},
"placket": {
"name": "Placket",
"id": 18
},
@localredhead
localredhead / grrrr.el
Last active August 29, 2015 14:05
pffft.
(add-hook 'ruby-mode-hook
(lambda ()
(run-at-time 10 nil
(lambda ()
(robe-mode 1)
(robe-start)))))
@localredhead
localredhead / delete branches
Created October 16, 2014 22:46
delete all branches
$ git branch | grep -v "master" | xargs git branch -D
# spec/lib/tasks/notification_rake_spec.rb
require 'spec_helper'
describe 'notifications:weekly' do
include_context "rake"
let(:users){ [double(:user)] }
let(:user_deliveries){ double(:user_deliveries) }
before{ User.stub(:all).and_return( users ) }
npm install -g jsxhint

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@localredhead
localredhead / restclient
Created March 31, 2015 03:15
Restclient file
## address bug
:var = GQh6z916qptswjtTd4KV
PUT http://client.archer.dev/svc/user/addresses/xxxxx
HTTP_AUTHORIZATION: :var
Content-Type: application/json
{
"address": {
"address": {
"address1": "1801 East St.",
"address2": "",
@localredhead
localredhead / development.rb
Created April 10, 2015 01:26
CORS development.rb
config.middleware.insert_before 0, "Rack::Cors", :debug => true, :logger => (-> { Rails.logger }) do
allow do
origins '*'
resource '/cors',
:headers => :any,
:methods => [:post],
:credentials => true,
:max_age => 0