Skip to content

Instantly share code, notes, and snippets.

Predicate Return Value Part 2
Predicate Return Value Part 2
Predicate Return Value Part 2
https://gist.github.com/f839f76aebceb380a827
295 Predicate Return Value Part 2
APP_VERSION = `git describe --tags --abbrev=0`.strip unless defined? APP_VERSION
=begin
Plugin: Github Logger
Version: 1.1
Description: Logs daily Github activity for the specified user
Author: [Brett Terpstra](http://brettterpstra.com)
Configuration:
github_user: githubuser
github_tags: "#social #coding"
Notes:
@andrewbroman
andrewbroman / antispam.html
Created August 13, 2012 17:49
HTML: anti-spam form idea
<input type="text" id="not_human" name="name" />
<input type="text" name="actual_name" />
<style>
#not_human { display: none }
</style>
@andrewbroman
andrewbroman / ancestors.rb
Created August 11, 2012 18:23
Ruby: return array of ancestors
def ancestors(obj)
anc = []
klass = obj.class
until klass.nil? do
anc << klass
klass = klass.superclass
end
anc
end
@andrewbroman
andrewbroman / checksum.rb
Created July 12, 2012 16:16
Ruby: create checksum on hash
# Thanks to tenderlove on Peepcode play by play
require 'digest/md5'
def fetch username
records = JSON.parse get username
records.each do |hash|
checksum = Digest::MD5.hexdigest Marshal.dump(hash)
hash['checksum'] = checksum
end