Skip to content

Instantly share code, notes, and snippets.

View hannahherbig's full-sized avatar

Hannah Herbig hannahherbig

View GitHub Profile
@hannahherbig
hannahherbig / index.js
Created May 15, 2014 18:20
requirebin sketch
var console = require('demo-console')
process.nextTick(function () {
console.log('hi')
})
diff --git a/svn2git/README.markdown b/svn2git/README.markdown
index c4bffa9..d646c13 100644
--- a/svn2git/README.markdown
+++ b/svn2git/README.markdown
@@ -81,30 +81,30 @@ svn repo. The differentiating factor is the svn repo layout. Below is an
enumerated listing of the varying supported layouts and the proper way to
create a git repo from a svn repo in the specified layout.
-1. The svn repo is in the standard layout of (trunk, branches, tags) at the
-root level of the repo.
diff --git a/svn2git/README.markdown b/svn2git/README.markdown
index c4bffa9..d646c13 100644
--- a/svn2git/README.markdown
+++ b/svn2git/README.markdown
@@ -81,30 +81,30 @@ svn repo. The differentiating factor is the svn repo layout. Below is an
enumerated listing of the varying supported layouts and the proper way to
create a git repo from a svn repo in the specified layout.
-1. The svn repo is in the standard layout of (trunk, branches, tags) at the
-root level of the repo.
/Users/andrew/dev/rhudrop/lib/rhudrop.rb:353:in `do_join': undefined method `channel=' for nil:NilClass (NoMethodError)
from /Users/andrew/dev/rhudrop/lib/rhudrop/events.rb:17:in `block in set_event_handlers'
from /usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/rhuidean-1.1.0/lib/rhuidean/event.rb:102:in `call'
from /usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/rhuidean-1.1.0/lib/rhuidean/event.rb:102:in `block in run'
from /usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/rhuidean-1.1.0/lib/rhuidean/event.rb:102:in `each'
from /usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/rhuidean-1.1.0/lib/rhuidean/event.rb:102:in `run'
from /usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/rhuidean-1.1.0/lib/rhuidean/client.rb:351:in `block in io_loop'
from /usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/rhuidean-1.1.0/lib/rhuidean/client.rb:340:in `loop'
from /usr/local/Cellar/ruby/1.9.2-p0/lib/ruby/gems/1.9.1/gems/rhuidean-1.1.0/lib/rhuidean/client.rb:340:in `
[andrew ~/dev/feed] $ ruby feed.rb
I, [11/20 01:12:04 #9031] INFO -- client.rb:400:in `connect': connecting to irc.mcintec.net:6667
D, [11/20 01:12:04 #9031] DEBUG -- client.rb:236:in `write': NICK rhuidean
D, [11/20 01:12:04 #9031] DEBUG -- client.rb:236:in `write': USER rhuidean irc.mcintec.net irc.mcintec.net :andrew12's rhuidean bot (ruby!)
D, [11/20 01:12:04 #9031] DEBUG -- client.rb:284:in `block in parse': :Matrix.McInTEC.net NOTICE AUTH :*** Looking up your hostname...
D, [11/20 01:12:04 #9031] DEBUG -- client.rb:284:in `block in parse': :Matrix.McInTEC.net NOTICE AUTH :*** Found your hostname
D, [11/20 01:12:04 #9031] DEBUG -- client.rb:284:in `block in parse': :IRC!IRC@Matrix.McInTEC.net PRIVMSG rhuidean :VERSION
D, [11/20 01:12:04 #9031] DEBUG -- client.rb:284:in `block in parse': :Matrix.McInTEC.net 001 rhuidean :Welcome to the McInTEC-IRC Community Network rhuidean!rhuidean@pool-71-166-152-240.washdc.east.verizon.net
@hannahherbig
hannahherbig / autoreload.rb
Created September 18, 2011 20:24
Put this in any folder that you want to be reloaded automatically if one of the files change, or if a new one is added, then require it.
require 'fssm' # gem install fssm
Thread.abort_on_exception = true
Thread.new do
FSSM.monitor(File.expand_path('.', File.dirname(__FILE__)), '**/*') do
block = proc do |b, r|
fn = File.join(b, r)
load fn
puts "reloaded #{fn}"
@hannahherbig
hannahherbig / example.rb
Created October 22, 2011 21:37
Example gist
puts "This gist is a test."
@hannahherbig
hannahherbig / reddit_polling.rb
Created November 22, 2011 03:04
just an example of how you can poll reddit
require 'open-uri'
require 'json'
received_posts = [] # posts we've already received
loop do
# get all of the current posts
posts = open('http://www.reddit.com/new.json') { |f| JSON.parse(f.read) }
posts = posts['data']['children']
# Byte counts don't include newlines, def... and end
# Hole 1: 61 bytes
def fizzbuzz(n)
"FizzBuzz#{n}"[(n%3<1?0:(n%5<1?4:8))..(n%5<1?7:(n%3<1?3:-1))]
end
# Hole 2: 72 bytes
def caesar(s,n)
s.tr "a-zA-Z",(h="#{(a=(?a..?z).to_a*'')[n%=26]}-za-#{a[n+1]}")+h.upcase
>> o = GitHub.org('github')
=> #<GitHub::Organization avatar_url="https://secure.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png" blog="https://github.com/about" company=nil created_at="2008-05-11T04:37:31Z" email="support@github.com" followers=622 following=0 html_url="https://github.com/github" id=9919 location="San Francisco, CA" login="github" name="GitHub" public_gists=0 public_repos=36 type="Organization" url="https://api.github.com/orgs/github">
>> o.login
=> "github"
>> o.id
=> 9919
>> o.company
=> nil # yes, this is right. it's nil above, which is what the api returns for whatever reason
>> o.type
=> "Organization"