Skip to content

Instantly share code, notes, and snippets.

@danbronsema
danbronsema / Cartel
Created August 10, 2011 12:34
Grabbing big cartel stuff in rails
******* ADDED TO GEMFILE ***********
gem 'httparty'
******* IN THE MODEL ***********
class Project < ActiveRecord::Base
include HTTParty
format :plain
@danbronsema
danbronsema / rspec performance test
Created December 9, 2011 12:06
Performance testing in Rspec
context 'performance' do
before do
require 'benchmark'
@posts = []
@users = []
8.times do |n|
user = Factory.create(:user)
@users << user
aspect = user.aspects.create(:name => 'people')
connect_users(@user, @aspect0, user, aspect)
@danbronsema
danbronsema / responsivemenu.css
Created May 3, 2012 11:02
CSS - Responsive Menu in Bootstrap
@media (max-width: 979px) {
body {
padding-top: 0;
}
.navbar-fixed-top {
position: static;
margin-bottom: 18px;
}
.navbar-fixed-top .navbar-inner {
padding: 5px;
@danbronsema
danbronsema / gist:3487459
Created August 27, 2012 10:59
RailsKit Factories
FactoryGirl.define do
factory :account do
sequence(:name) {|n| "Hat Store #{n}"}
sequence(:full_domain) {|n| "hatstore#{n}"}
admin
subscription
end
factory :user do