This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://neovore.com / somethingfamiliar(at)gmail.com | |
# dirt simple twitter retweeter with twibot | |
require 'twibot' | |
#-- in ./config/bot.yml: | |
#login: your_user_name | |
#password: your_password | |
#include_friends: true | |
#-- EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if @foo.save && @bar.save | |
# if @foo fails, then @bar.save never gets called. BAD! | |
end | |
# instead: | |
if @foo.save & @bar.save | |
# both methods get called regardless | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# = Delighter - pull your twitter links into delicious. | |
# | |
# Takes the first link and submits it to delicious. The description | |
# will be the text up to the beginning of the link, the tags whatever | |
# hashtags are on the tweet. Let me know if you improve on this, it was | |
# pretty q&d. | |
# | |
# author: Ben Vandgrift <br/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# throw something like this in an initializer | |
ActionController::Base.class_eval do | |
self.prepend_view_path "first/search/here" | |
# then the defaults (app/views/*) | |
self.append_view_path "then/search/here" | |
end | |
# an example, say you want a theme, and the name is stored in App.theme_name? | |
ActionController::Base.class_eval do | |
self.prepend_view_path "themes/#{App.theme_name}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# any help with the following would be awesome (@bvandgrift) | |
# here's the problem code (ish) | |
# testing the stuff in the 'chunkify' block sucks | |
def make_breakfast | |
# ... | |
dough_for_biscuits = DoughBro.new | |
dough_for_biscuits.chunkify do |chunk| | |
if chunk.any? | |
the_good_stuff = roll_dem_biscuits(chunky) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Role.delete_all | |
role_names = Authorization::Engine.instance.roles | |
role_names.each { |name| Role.find_or_create_by_name!(name) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect { | |
touched.each { |life| experience << life unless life.empty? } | |
}.to change direction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure Riak connections for the Ripple library. | |
development: | |
#http_port: 8092 | |
# pb_port: 8087 | |
nodes: | |
- host: 192.168.31.2 | |
http_port: 8092 | |
- host: 127.0.0.1 | |
http_port: 8091 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
for x in `seq 1 20`; do | |
for y in `seq 1 20`; do | |
for n in n s; do | |
for e in e w; do | |
wget "http://imgs.xkcd.com/clickdrag/${x}${n}${y}${e}.png" | |
sleep 1 | |
done | |
done |
OlderNewer