Skip to content

Instantly share code, notes, and snippets.

@blakesmith
blakesmith / code_review_essentials.md
Last active August 29, 2015 14:13
Code Review Essentials for Software Teams

Code Review Essentials for Software Teams

Code Review is an essential part of any collaborative software project. Large software systems are usually written by more than one person, and so a highly functioning software team needs a robust process to keep its members, as well as the code base itself moving in the right direction.

Code Review is a powerful tool that:

@blakesmith
blakesmith / gist:43732
Created January 6, 2009 08:49
script for taking a tracklist and generating a blank cuesheet
#!/usr/bin/env python
import sys
import re
def do_parse(in_file, out_file):
try:
track_file = open(in_file, "r").read()
except:
print "Unable to open specified file, check the path."
#!/usr/bin/env python
import urllib
import urllib2
import getpass
import sys
import datetime
import time
class BlockReserve(object):
=> Booting WEBrick
=> Rails 3.0.0.beta3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/blake/.bundle/ruby/1.9.1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-d916c62cfc7c59ab6411/activesupport/lib/active_support/dependencies.rb:440:in `load_missing_constant': ActiveRecord is not missing constant Timestamp! (ArgumentError)
from /home/blake/.bundle/ruby/1.9.1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-d916c62cfc7c59ab6411/activesupport/lib/active_support/dependencies.rb:153:in `block in const_missing'
from /home/blake/.bundle/ruby/1.9.1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-d916c62cfc7c59ab6411/activesupport/lib/active_support/dependencies.rb:151:in `each'
from /home/blake/.bundle/ruby/1.9.1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-d916c62cfc7c59ab6411/activesupport/lib/active_support/dependencies.rb:151:in `const_missing'
from /home/blake/.bundle/ruby/1.9.
class Migration
class << self
def create_table(name, &block)
table = Table.new name
table.evaluate &block
table.create
end
def drop_table(name)
table = Table.new name
def keep_stdout(&block)
begin
orig_stream, $stdout = $stdout, StringIO.new
block.call($stdout)
ensure
s, $stdout = $stdout.string, orig_stream
s
end
end
require 'rubygems'
require 'inline'
class MyTestInC
inline do |builder|
builder.c <<-EOF
long factorial(int max) {
int i=max, result=1;
while (i >= 2) {
result *= i--;
From d4ed463815b8c7afcf95500a73754f2bca6b1b13 Mon Sep 17 00:00:00 2001
From: Blake Smith <blakesmith0@gmail.com>
Date: Tue, 29 Jun 2010 23:43:26 -0500
Subject: [PATCH] Fix garbled UTF-8 characters
---
.../2010-01-16-fully-document-your-datamapper.html | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/_posts/2010-01-16-fully-document-your-datamapper.html b/_posts/2010-01-16-fully-document-your-datamapper.html
#!/usr/bin/env ruby
#
#
# Quick and dirty script to extract some statistics about
# Rails core contributers.
#
# Usage: git_core_stats <path to rails git project>
# Example: git_core_stats ~/code/rails
#
# OR
irb(main):001:0> require 'maruku'
=> true
irb(main):002:0> s = File.read('maruku-test')
=> "* Abacus\n * answer\n* Bubbles\n 1. bunk\n 2. bupkis\n * BELITTLER\n 3. burper\n* Cunning\n"
irb(main):003:0> doc = Maruku.new(s)
=> md_el(:document,[
md_el(:ul,[
md_el(:li,[md_par(["Abacus * answer"])],{:want_my_paragraph=>false},[]),
md_el(:li,[
md_par(["Bubbles"]),