Skip to content

Instantly share code, notes, and snippets.

View jkamenik's full-sized avatar

John Kamenik jkamenik

View GitHub Profile
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
@subelsky
subelsky / move_github_repos.sh
Created April 10, 2012 16:30
How to archive old github private projects on Dropbox
# http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively/1961515#1961515
export REPONAME=????
take ~/Dropbox/git/$REPONAME.git
git init --bare
cd ~/code/$REPONAME
git remote rm origin
git remote add origin ~/Dropbox/git/$REPONAME.git
git push -u origin master
@tddium
tddium / campfire.rb
Last active October 2, 2015 13:58
Campfire Post-Build Notifier
#!/usr/local/bin/ruby
# Copyright (c) 2012 Solano Labs All Rights Reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
@avdi
avdi / apology101.markdown
Created March 22, 2012 17:36
How to apologize

Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.

You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template:

@jjulian
jjulian / apache.conf
Created February 23, 2012 03:38
Apache rewrite rules to show a maintenance page
# Capistrano-style: if maintenance.html exists, it will be served for any request
# other than style and images. Use status code 503 to tell crawlers to come back later.
ErrorDocument 503 /system/maintenance.html
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ - [redirect=503,last]
@pjb3
pjb3 / def_scope.rb
Created December 14, 2010 14:16
Fixes ActiveRecord's named_scope API. Place this into config/initializers/def_scope.rb
# Having to use a lambda when defining a scope is ugly and stupid
# I've never had a use case for a scope extension
# This allows us to just use a block
module DefScope
def def_scope(name, &blk)
scope name, blk
end
end
ActiveRecord::Base.extend DefScope