Skip to content

Instantly share code, notes, and snippets.


Keith Marcum kamarcum

  • GitHub Staff
  • Nashville, TN
Block or report user

Report or block kamarcum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kamarcum on github.
  • I am marcumka ( on keybase.
  • I have a public key ASAynjVN61cYaJlclYt724DG5FJUN-hwno7irZL9pQAHNgo

To claim this, I am signing this object:


Keybase proof

I hereby claim:

  • I am kamarcum on github.
  • I am marcumka ( on keybase.
  • I have a public key whose fingerprint is CB99 CCE3 96C2 713F F5E4 539D 86A5 4353 248A F6FC

To claim this, I am signing this object:

kamarcum /
Created Jun 25, 2014
Inspect requests on a server with rack
gem install rack ; echo "run { |env| puts env.inspect; ['200', {'Content-Type' => 'text/html'}, [env.inspect]] }" >> ; rackup
kamarcum / gist:9486644
Created Mar 11, 2014
Find your tallest postgres tables
View gist:9486644
ActiveRecord::Base.connection.execute("SELECT relname, reltuples FROM pg_class where relname NOT LIKE 'pg_%' ORDER BY reltuples DESC LIMIT 10;").each { |row| puts row }
View app_helper.rb
module ApplicationHelper
def weasel(opts={})
def wrapper(target=self)
kamarcum / gist:5547845
Created May 9, 2013
Basic format for standups
View gist:5547845
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="">
<xs:element name="Status">
<xs:element name="Location">
<xs:restriction base="xs:string">
<xs:enumeration value="The Office" />
<xs:enumeration value="Remote" />
kamarcum / do_these_things
Last active Dec 14, 2015
This is how I set up development machines sometimes.
View do_these_things
1. Xcode
2. xcode command line tools
3. git
4. brew install libksba autoconf automake apple-gcc42 qt imagemagick libxml2 postgres tmux macvim
5. fix imagemagick library names (see below)
6. x11
7. rvm
8. dotmatrix
kamarcum / student_controller.rb
Created Nov 19, 2012
A probably incorrect live-coded eTag example that doesn't use the eTag middleware
View student_controller.rb
class StudentController < ApplicationController
def show
existing_etag = request.headers["if-none-match"]
student = Student.where(id: params[:id]).first
type, id, modified = existing_etag.split("_")
if(type == student && id == params[:id])
if(student.updated_at == modified)
render :not_modified and return
kamarcum / utf_8.rb
Created Oct 28, 2012
Generating non-UTF-8 strings in ruby for testing
View utf_8.rb
# It's sort of difficult to make a non-UTF-8 string in
# ruby that contains characters that aren't in UTF-8.
# Here's how I did it.
# 0x89 isn't allowed in UTF-8
bad_chars = [0x89].pack("c*").force_encoding("ISO-8859-1")
kamarcum / gist:3965475
Created Oct 27, 2012
Rudely reclaim port 3000.
View gist:3965475
kill -9 `lsof -i :3000 -F p | cut -c 2-10`
alias gorailsgo='kill -9 `lsof -i :3000 -F p | cut -c 2-10` ; rails s'
You can’t perform that action at this time.