Skip to content

Instantly share code, notes, and snippets.

View pengwynn's full-sized avatar

Wynn Netherland pengwynn

View GitHub Profile
// change thematic's default nav to be category based instead of page based
// Create #access
// In the header div
function mytheme_access() { ?>
<div id="access">
<div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content', 'thematic'); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div>
<!-- list categories instead, see args here: http://codex.wordpress.org/Template_Tags/wp_list_categories -->
<?php wp_list_categories('orderby=name&show_count=1&exclude=10'); ?>
</div><!-- #access -->
# Are you ready to Tumblllllllllllllllllllllllllllllllle?
sudo gem install gemcutter
gem tumble
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.
require 'rubygems'
require 'twitter'
h = Twitter::HTTPAuth.new 'username', 'password'
twitter = Twitter::Base.new(h)
source_user = 'username'
source_slug = 'list-name'
target_user = 'username'
target_slug = 'list-name'
# Set up .gitignore
file '.gitignore', <<-GITIGNORE
config/database.yml
log/*.log
tmp/**/*
.DS\_Store
.DS_Store
db/test.sqlite3
db/development.sqlite3
/log/*.pid
# Set up Compass/Sass
require 'sass/plugin/rack'
require 'compass'
use Sass::Plugin::Rack
Compass.configuration do |config|
config.project_path = File.dirname(__FILE__)
config.sass_dir = "sass"
config.css_dir = "public/css"
end
Compass.configure_sass_plugin!
<script src="http://www.buzzsprout.com/105/2916-episode-0-1-5-leah-culver-on-oauth-hurl-it-baconfile-and-more.js?player=small" type="text/javascript" charset="utf-8"></script>
run "rm public/index.html"
generate(:rspec)
generate(:cucumber)
plugin 'resource_controller', :git => 'git://github.com/jamesgolick/resource_controller.git'
plugin 'flash-message-conductor', :git => 'git://github.com/planetargon/flash-message-conductor.git'
gem "formtastic"
gem "pickle"
gem "machinist"
> db.testdots.save({foo: 'bar', tags: ['web2.0', 'mongofail']})
> db.testdots.findOne();
{
"_id" : ObjectId("4bb7992356756e741e3574a1"),
"foo" : "bar",
"tags" : [
"web2.0",
"mongofail"
]
}