Skip to content

Instantly share code, notes, and snippets.

View snoblenet's full-sized avatar

Steven Noble snoblenet

View GitHub Profile
@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"/>
<?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: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

@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: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: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:5974767
Created July 11, 2013 11:47
spec_helper.rb
require "rubygems"
# require "spork"
require "database_cleaner"
# require "ruby-debug"
# require "pry"
# require "plymouth" # automatically drops a failing test into a pry session, but doesn't work with zues/parallel_tests
#uncomment the following line to use spork with the debugger
#require "spork/ext/ruby-debug"
/**
* WkHtmlToPdf table splitting hack.
*
* Forked and edited to include my own values
*
* Script to automatically split multiple-pages-spanning HTML tables for PDF
* generation using webkit.
*
* To use, you must adjust pdfPage object's contents to reflect your PDF's
* page format.
<?php
function url2png_v6($url, $args) {
# Get your apikey from http://url2png.com/plans
$URL2PNG_APIKEY = "PXXXX";
$URL2PNG_SECRET = "SXXXX";
# urlencode request target
$options['url'] = urlencode($url);
Stevens-MacBook-Air-2:testivate steven$ heroku logs --app testivate
2015-06-21T06:14:36+00:00 app[heroku-postgres]: source=HEROKU_POSTGRESQL_SILVER sample#current_transaction=35588211 sample#db_size=307467384bytes sample#tables=21 sample#active-connections=5 sample#waiting-connections=0 sample#index-cache-hit-rate=0.95747 sample#table-cache-hit-rate=0.84423 sample#load-avg-1m=0.07 sample#load-avg-5m=0.105 sample#load-avg-15m=0.135 sample#read-iops=0 sample#write-iops=0.20825 sample#memory-total=7629452kB sample#memory-free=567436kB sample#memory-cached=6285748kB sample#memory-postgres=261260kB
2015-06-21T06:14:46.971712+00:00 heroku[router]: at=info method=GET path="/" host=testivate.com request_id=f2784ec8-d110-4799-8657-4d631e724d28 fwd="180.76.15.7" dyno=web.1 connect=0ms service=9ms status=301 bytes=180
2015-06-21T06:14:51.016279+00:00 app[web.1]: Started GET "/" for 101.176.176.218 at 2015-06-21 06:14:51 +0000
2015-06-21T06:14:51.482251+00:00 app[web.1]: Processing by HighVoltage::PagesController#show as