Skip to content

Instantly share code, notes, and snippets.

View tubbo's full-sized avatar
:shipit:
i don't make rails apps you use, i make the rails apps you use faster..

Tom Scott tubbo

:shipit:
i don't make rails apps you use, i make the rails apps you use faster..
View GitHub Profile
*** LOCAL GEMS ***
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
addressable (2.2.1)
aws-s3 (0.6.2)
@tubbo
tubbo / gist:608718
Created October 3, 2010 16:55
error when i try to git clone on an iPhone
Dylan:/private/var/stash/Themes root# git clone "http://github.com/dcinzona/LockInfo-Status-Bar-Icons---Winterboard-Theme.git/GMT Statusbar Icons.theme"Initialize GMT Statusbar Icons.theme/.git
Initialized empty Git repository in /private/var/stash/Themes/GMT Statusbar Icons.theme/.git/
error: File 0000000000000000000000000000000000000000 (http://github.com/dcinzona/LockInfo-Status-Bar-Icons---Winterboard-Theme.git/GMT Statusbar Icons.theme/objects/00/00000000000000000000000000000000000000) corrupt
Getting pack list for http://github.com/dcinzona/LockInfo-Status-Bar-Icons---Winterboard-Theme.git/GMT Statusbar Icons.theme
Getting alternates list for http://github.com/dcinzona/LockInfo-Status-Bar-Icons---Winterboard-Theme.git/GMT Statusbar Icons.theme
Also look at "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona
Also look at <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lan
Also look at <h2 class="logo"><a href="http://github.com">Brought to you by GitHub</
Also look at <li><a href
function initMenu() {
$('#menu ul').hide();
//$('#menu ul:first').show();
if ($('#menu ul').is('.active')) {
$('#menu ul.active').show();
}
if ($('#menu ul li').is('.active')) { //#elm has the class} else { //#elm doesn't have the class}
$('li.active').parent().addClass("active");
$('#menu ul.active').show();
}
@tubbo
tubbo / post_spec.rb
Created December 19, 2010 22:25
RSpec tests for Post
require 'spec_helper'
describe Post do
context "A post (in general)" do
setup do
@post=Post.new({
:id => 1,
:created_at => Time.now
})
end
@tubbo
tubbo / spec_helper.rb
Created December 19, 2010 22:42
RSpec for Rails
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
@tubbo
tubbo / factories.rb
Created December 22, 2010 01:17
factory_girl defs for psycho
# Test cases
# Factory.define :user do |u|
# u.login 'tubbo'
# u.password ''
# u.password_confirmation ''
# end
# generate random strings
Factory.sequence :category_name do |n|
// Given we have an Active Record class that maps a DB table
var post=new ActiveRecord('posts', {
id: new AR_Integer(),
title: new AR_String(255),
body: new AR_Text()
});
/*
This ActiveRecord object needs to:
jQuery(function($) {
// create a convenient toggleLoading function
var fooToggleSpinner = function() { $("#divSpinner").toggle() };
$("#runSpinner")
.bind("ajax:loading", fooToggleSpinner)
.bind("ajax:complete", fooToggleSpinner)
jQuery(function($) {
$("#runSpinner").bind("ajax:loading", function() { $("#divSpinner").show() });
$("#runSpinner").bind("ajax:complete", function() { $("#divSpinner").hide() });
@tubbo
tubbo / factories.rb
Created January 31, 2011 17:13
FactoryGirl definitions
# all factories for bacon's spec
FactoryGirl.define do
factory :user do
name 'Andrew Long'
login 'andrew' # @aplusldesign.com
password 'longj0hnsi|ver'
password_confirm 'longj0hnsi|ver'
end
factory :project do