Skip to content

Instantly share code, notes, and snippets.

View nevans's full-sized avatar

nicholas a. evans nevans

View GitHub Profile
@bitbckt
bitbckt / resque.rb
Created January 20, 2010 21:32
munin plugin for resque
#!/usr/bin/env ruby
require 'rubygems'
require 'resque'
HOST = ENV['host'] ? ENV['host'] : '127.0.0.1'
PORT = ENV['port'] ? ENV['port'] : '6379'
Resque.redis = "#{HOST}:#{PORT}"
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
@kbaum
kbaum / gist:892247
Created March 29, 2011 12:12
prune_workers_from_terminated_instance.rb
module Resque
def self.unregister_workers_for_host(host)
Resque.workers.select{|worker| worker.id.split(':').first==host}.each(&:unregister_worker)
end
end
Resque.unregister_workers_for_host("ip-10-250-192-51")
@pjb3
pjb3 / baltimore_hipster_guide.mdown
Created May 15, 2011 17:22
Hipster's Guide to Baltimore by @bmuller

Food

  • Little Italy has a number of great places (I think Amicci's has the best happy hour) and is accessible by the circulator's Orange Line.
  • Best pizza/risotto is Joe Squared on North Ave (purple line accessible).
  • Best Mexican is La Guadalupana on 500 South Wolfe Street (Orange/Green route will get you there). You will need to know some basic Spanish to order there, but the food is amazing.
  • Best odd assortment of random food is Lexington Market, the longest running market in the world(according to Wikipedia). It's accessible by heading north on the light rail and then walking West and would be good for lunch one day.
  • Best fancy food is Woodberry Kitchen, which is light rail accessible.
  • Best late night food is Never on Sunday on N Charles across the street from Helmand, which is open until 3:30am.
  • Best sushi is an easy pick - Kiku (1017 Light Street). It's a literal Mom and Pop operation with an amazing chirashi.
HAI
BTW Cheater's quine
I HAS A quine
GIMMEH LINEZ quine OUTTA "quine.lol"
I HAS A loop_max ITZ ALL quine
I HAS A loop_index ITZ 0
IM IN YR loop
IZ loop_index LIEK loop_max O RLY?
YA RLY
@rmoriz
rmoriz / install-ruby-debug-ruby-1.9.3.sh
Created November 29, 2011 02:17 — forked from hoverlover/install-ruby-debug-ruby-1.9.3.sh
ruby-debug in ruby-1.9.3 and rbenv
#!/bin/bash
cd /tmp
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/74596/ruby_core_source-0.1.5.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
wget http://rubyforge.org/frs/download.php/63094/ruby-debug19-0.11.6.gem
export RBENV_INCLUDE=$HOME/.rbenv/versions/1.9.3-p0/include/ruby-1.9.1/ruby-1.9.3-p0
gem install archive-tar-minitar
def output name=((default=true); "caius")
puts "name: #{name.inspect}"
puts "default: #{default.inspect}"
end
output
# >> name: "caius"
# >> default: true
output "avdi"
@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:

@unclebob
unclebob / apology.
Created April 27, 2012 12:19
Apology to Women Programmers.
Today I gave a keynote at ACCU in Oxford. In the midst of it I made two (count them) two statements that I should have known better than to make. I was describing the late '70s, and the way we felt about the C language at the time. My slide said something like: "C was for real men." Emily Bache, whom I know and hold in high regard, spoke up and said "What about women?". And I said something like: "We didn't allow women in those days." It was a dumb crack, and should either not have been said, or should have been followed up with a statement to the effect that that was wrong headed.
The second mistake I made was while describing Cobol. I mentioned Adm. Grace Hopper. I said something like "May she rest in peace." I don't know that any of the words were actually demeaning, but the tone was not as respectful as it should have been to an Admiral in the United State Navy, and one who was so instrumental in our industry; despite what I feel about Cobol.
I am a 59 year old programmer who was brought up
@datagrok
datagrok / git-branch-simplify.md
Last active April 16, 2024 17:26
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.