Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View snoblenet's full-sized avatar

Steven Noble snoblenet

View GitHub Profile
@snoblenet
snoblenet / gist:5974761
Created July 11, 2013 11:46
competitor_spec.rb
require "spec_helper"
describe "competitor" do
before :each do
@element = Element.create! :name => "meta", :meta => true
@standard = Standard.create! :name => "meta", :meta => true, :description => "meta"
@search = Product.create! :name => "Retail Site Search"
@mispellings = @search.questions.create! :description => "Cope with mispellings?", :element_id => @element.id, :standard_id => @standard.id, :active => true
@review = @search.reviews.create! :client_name => "BHP", :url => "http://bhp.com.au"
@snoblenet
snoblenet / gist:5974751
Created July 11, 2013 11:45
survey_spec.rb
require "spec_helper"
describe "survey" do
before :each do
@element = Element.create! :name => "meta", :meta => true
@standard = Standard.create! :name => "meta", :meta => true, :description => "meta"
@search = Product.create! :name => "Retail Site Search"
@mispellings = @search.questions.create! :description => "Cope with mispellings?", :instructions => "On the homepage, there is:", :element_id => @element.id, :standard_id => @standard.id, :active => true
@f1 = @mispellings.fields.create! :name => "Best practice", :points => 3.0
@snoblenet
snoblenet / gist:4499700
Created January 10, 2013 05:32
errors after installing Heroku Toolbelt
Last login: Thu Jan 10 16:27:37 on ttys000
Stevens-MacBook-Air:~ steven$ cd Dropbox/testivate
Stevens-MacBook-Air:testivate steven$ rspec
/Users/steven/.rvm/gems/ruby-1.9.3-p362/gems/better_errors-0.3.2/lib/better_errors/core_ext/exception.rb:9: [BUG] Segmentation fault
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-darwin12.2.1]
-- Control frame information -----------------------------------------------
c:0034 p:---- s:0104 b:0104 l:000103 d:000103 CFUNC :callers
c:0033 p:0064 s:0101 b:0101 l:0025c0 d:000c40 LAMBDA /Users/steven/.rvm/gems/ruby-1.9.3-p362/gems/better_errors-0.3.2/lib/better_errors/core_ext/exception.rb:9
c:0032 p:---- s:0098 b:0098 l:000097 d:000097 FINISH
@snoblenet
snoblenet / gist:3769753
Created September 23, 2012 11:20 — forked from rhysforyou/gist:3769749
How to Learn

Never in the history of the human race has there been a group as fortunate as computer science students. We have unlimited access to untold quantities of free information with which to better ourselves. We encounter few barriers that we can't overcome through hard work and a little ingenuity. We have the unparalleled ability to pursue our own ideas, follow what interests us and share our creations with the world.

So often I encounter individuals who tell me they'd love to build an iPhone app, make a game, launch a website, and so on. But often when I ask these individuals "what have you done so far?" I'm greeted with blank stares, usually followed by some excuse along the lines of "I wouldn't know where to start."

So that's what this is. The starting point.

A few pieces of advice

It's not going to be an easy journey of course, the ones worth taking rarely are. But a lot of the reason I started HackUOW was so that people wouldn't have to take the journey alone; that there would be people to give suppo

<?xml version="1.0"?>
<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01">
<OperationRequest>
<HTTPHeaders>
<Header Name="UserAgent" Value="Ruby"/>
</HTTPHeaders>
<RequestId>7ddcc985-758f-43aa-83a2-c4fbfacdcc47</RequestId>
<Arguments>
<Argument Name="Operation" Value="ItemSearch"/>
<Argument Name="Service" Value="AWSECommerceService"/>
@snoblenet
snoblenet / gist:1403905
Created November 29, 2011 07:46
Amazon Advertising API response in XML format
<?xml version="1.0"?>
<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01">
<OperationRequest>
<HTTPHeaders>
<Header Name="UserAgent" Value="Ruby"/>
</HTTPHeaders>
<RequestId>e8855f9f-fde3-4df8-bb4c-fe7cc521792a</RequestId>
<Arguments>
<Argument Name="Operation" Value="ItemSearch"/>
<Argument Name="Service" Value="AWSECommerceService"/>
<% if flash[:notice] -%>
<script>
jQuery(document).ready(function() {
humanMsg.displayMsg('<%= escape_javascript(h(flash[:notice])) %>');
})
</script>
<% end -%>
class CreateSlugs < ActiveRecord::Migration
def self.up
create_table :slugs do |t|
t.string :name
t.integer :sluggable_id
t.integer :sequence, :null => false, :default => 1
t.string :sluggable_type, :limit => 40
t.string :scope, :limit => 40
t.datetime :created_at
end
class CreateImages < ActiveRecord::Migration
def self.up
create_table :images do |t|
t.references :solution
t.string :data_file_name
t.string :data_content_type
t.integer :data_file_size
t.datetime :data_updated_at
t.string :description
t.integer :part_id
class CreateProjectparts < ActiveRecord::Migration
def self.up
create_table :projectparts do |t|
t.string :name
t.text :description
t.integer :user_id
t.integer :parent_id
t.integer :lft
t.integer :rgt
t.integer :project_id