Skip to content

Instantly share code, notes, and snippets.

@johnlauck
johnlauck / OpenRailsProject.scpt
Created August 19, 2009 20:53
Open a rails project terminal session using this AppleScript
(*
Open Project
Open a Rails Project
opens git-sh, console, server, autospec and a command line
*)
on run
set dirs to {}
# DO NOT MODIFY THIS FILE
require 'digest/sha1'
require "rubygems"
module Bundler
module SharedHelpers
def default_gemfile
gemfile = find_gemfile
When /^(?:|I )select "([^\"]*)" as the "([^\"]*)" date$/ do |date, date_label|
select_date(date, :from => date_label)
end
DATE_TIME_SUFFIXES = {
:year => '1i',
:month => '2i',
:day => '3i',
:hour => '4i',
:minute => '5i'
>> require 'fastercsv'
require 'fastercsv'
=> []
>> FasterCSV
=> FasterCSV
>> FasterCSV.parse
ArgumentError: wrong number of arguments (0 for 1)
from /Users/john/.rvm/gems/ree-1.8.7-2010.02/gems/fastercsv-1.5.3/lib/faster_csv.rb:1226:in `initialize'
from /Users/john/.rvm/gems/ree-1.8.7-2010.02/gems/fastercsv-1.5.3/lib/faster_csv.rb:1226:in `new'
from /Users/john/.rvm/gems/ree-1.8.7-2010.02/gems/fastercsv-1.5.3/lib/faster_csv.rb:1226:in `parse'
<!-- Discover Ohio http://consumer.discoverohio.com/searchdetails.aspx?detail=55409 -->
<head>
<meta name="keywords" content="Dream Horse Guesthouse (B&amp;B), things to do in Kinsman, (330) 876-0428">
<meta name="description" content="Bring pets/horses! Experience a timber frame barn Bed &amp; Breakfast and gift store in the resort area of Lake Pymatuning State Park (NE Ohio). Horseback riding and/or massage by advance reservation....">
<meta name="listingtype" content="attraction">
<meta name="isSpecialOffer" content="true">
<meta name="Lodging" content="cat">
<meta name="region" content="Northeast">
<meta name="image" content="5279_thumb_10262006135336.jpg">
</head>
.sidebar-handle-view {
@include transition(left 300ms);
color: #fff;
position: absolute;
top: 14px;
left: 360px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 24px;
@johnlauck
johnlauck / .gitconfig
Created August 27, 2013 15:06
gitconfig
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[color "branch"]
current = yellow reverse
@johnlauck
johnlauck / postgres_queries_and_commands.sql
Created June 6, 2016 14:43 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@johnlauck
johnlauck / 0-s3_redirect.md
Last active June 27, 2016 19:53
How to simply redirect an S3 bucket to any URL

Given a vanity/campaign URL, this is the simplest way to provide a server side redirect with 0 infrastucture overhead:

  1. Create a bucket
  2. Open GET access to the bucket as shown below in bucket-policy-example.json (more info available in AWS S3 Static Hosting docs)
  3. Enable website hosting on the bucket
  4. Under Edit Redirection Rules, add XML similar to routing-rules.xml below. Read more about Routing Rules for additional options.
  5. Assign an A record in Route 53 by aliasing the bucket.
@johnlauck
johnlauck / keybase.md
Created April 6, 2017 19:45
keybase.md

Keybase proof

I hereby claim:

  • I am johnlauck on github.
  • I am johnlauck (https://keybase.io/johnlauck) on keybase.
  • I have a public key ASDHHefkENH3BQ6C_4EXnRINF1gfuBUXGOrj7oGNiAkE1wo

To claim this, I am signing this object: