Skip to content

Instantly share code, notes, and snippets.

Avatar
Living on a sailboat

Brandon Keepers bkeepers

Living on a sailboat
View GitHub Profile
View gist:1885
def slow_each(options, &block)
0.step(count(options), options[:limit]) do |offset|
find(:all, options.merge(:offset => offset)).each(&block)
end
end
View keybase.md

Keybase proof

I hereby claim:

  • I am bkeepers on github.
  • I am bkeepers (https://keybase.io/bkeepers) on keybase.
  • I have a public key whose fingerprint is 8AF6 4385 E45B 03AA 72D7 DE72 F524 D391 D545 3EF9

To claim this, I am signing this object:

@bkeepers
bkeepers / twitnoise
Created Jun 3, 2014
Signal & Noise lists on Twitter
View twitnoise
#!/bin/bash
#
# This script encapsulates my process for keeping up with Twitter:
#
# 1. Create a private list called Signal, add everyone you currently follow to
# it, and begin curating it.
# 2. Follow everyone you meet or find interesting.
# 3. Create a private list called Noise, containing everyone you follow that are
# not in Signal.
# 4. Use Signal as your timeline in tweetbot. Switch to Noise when you are bored
@bkeepers
bkeepers / dabblet.css
Created Sep 15, 2014
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
View README.md

Issue and Pull Request Age

@bkeepers
bkeepers / modelines.rb
Last active Aug 29, 2015
Regular expression for vim and emacs modelines.
View modelines.rb
/
(?:
(-\*- \s* (?:mode:)? \s*) | # $1: Emacs
(\/\* \s* vim: \s* set \s* (?:ft|filetype)=) # $2: Vim
)
(\w+) # $3: language
(?:
(?(1) # If $1 matched...
;?\s* -\*- | # then close Emacs syntax
: \s* \*\/ # otherwise close Vim syntax
View gist:3157
def test_invalidate_tree
r1 = Category.create
r2 = Category.create
r3 = Category.create
r4 = Category.create
nodes = [r1, r2, r3, r4]
r2.move_to_child_of(r1)
nodes.each(&:reload)
assert Category.valid?
View gist:055a148eb742fb9df736
>> require 'org-ruby'
>> puts Orgmode::Parser.new(File.read('/tmp/test.org')).to_html
<ul>
<li>Item 1</li>
<li>Item 2
<pre class="example">
Example
Example
Example
</pre>
You can’t perform that action at this time.