Skip to content

Instantly share code, notes, and snippets.

View BrianTheCoder's full-sized avatar

Brian Smith BrianTheCoder

View GitHub Profile
module ExploreDallas
module Eventful
def self.events(options = {})
resp = client.get do |req|
req.url 'events/search'
req.params[:location] = "#{options[:lat]},#{options[:lng]}"
req.params[:within] = 5
req.params[:units] = 'mi'
req.params[:sort_order] = 'date'
req.params[:sort_direction] = 'ascending'
@BrianTheCoder
BrianTheCoder / gist:2638811
Created May 8, 2012 19:48
reddit_motion.rb
class RedditPost
attr_accessor :title, :url, :author
attr_accessor :comments, :score
attr_accessor :subreddit
def initialize(data)
@url = data["url"]
@title = data["title"]
@author = data["author"]
@comments = data["num_comments"]
sudo npm install -g underscore.string
npm http GET https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/underscore.string
npm WARN underscore.string@2.0.0 dependencies field should be hash of <name>:<version-range> pairs
underscore.string@2.0.0 /usr/local/lib/node_modules/underscore.string
ubuntu@ip-10-116-142-50:~/Blurtt/Backend/blurtt_api$ PORT=3000 NODE_ENV=production node app.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
/Users/wbsmith83/code/dialexa/MileMeter-Projects/billing/Gemfile:3:in `evaluate': compile error
/Users/wbsmith83/code/dialexa/MileMeter-Projects/billing/Gemfile:3: syntax error, unexpected ':', expecting $end
gem 'bson_ext', require: 'bson'
^ (SyntaxError)
/Users/wbsmith83/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/definition.rb:18:in `build'
/Users/wbsmith83/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler.rb:135:in `definition'
/Users/wbsmith83/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/cli.rb:220:in `install'
/Users/wbsmith83/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/vendor/thor/task.rb:22:in `send'
/Users/wbsmith83/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/vendor/thor/task.rb:22:in `run'
/Users/wbsmith83/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.1/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
/Users/wbsmith83/.rvm/gems/ruby-1.9.2-p290@metal/gems/yard-0.7.5/lib/yard.rb:38: [BUG] Bus Error
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
-- control frame ----------
c:0019 p:---- s:0074 b:0074 l:000073 d:000073 CFUNC :callcc
c:0018 p:0080 s:0071 b:0071 l:002150 d:002150 TOP /Users/wbsmith83/.rvm/gems/ruby-1.9.2-p290@metal/gems/yard-0.7.5/lib/yard.rb:38
c:0017 p:---- s:0068 b:0068 l:000067 d:000067 FINISH
c:0016 p:---- s:0066 b:0066 l:000065 d:000065 CFUNC :require
c:0015 p:0053 s:0062 b:0062 l:000da8 d:000da8 METHOD /Users/wbsmith83/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36
c:0014 p:0030 s:0055 b:0055 l:000bc8 d:000bc8 METHOD /Users/wbsmith83/.rvm/gems/ruby-1.9.2-p290@metal/gems/yard-0.7.5/lib/yard/rubygems/doc_manager.rb:5
@BrianTheCoder
BrianTheCoder / gist:1961588
Created March 2, 2012 21:40
application.scss
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require bootstrap
*/
@import "compass";
body {
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: connect ECONNREFUSED
at errnoException (net.js:640:11)
at Object.afterConnect [as oncomplete] (net.js:631:18)
body: '{\n "results" : [\n {\n "address_components" : [\n {\n "long_name" : "1701-1739",\n "short_name" : "1701-1739",\n "types" : [ "street_number" ]\n },\n {\n "long_name" : "N Griffin St",\n "short_name" : "N Griffin St",\n "types" : [ "route" ]\n },\n {\n "long_name" : "Historic District",\n "short_name" : "Historic District",\n "types" : [ "neighborhood", "political" ]\n },\n {\n "long_name" : "Dallas",\n "short_name" : "Dallas",\n "types" : [ "locality", "political" ]\n },\n {\n "long_name" : "Dallas",\n "short_name" : "Dallas",\n "types" : [ "administrative_area_level_2", "political" ]\n },\n {\n "long_name" : "Texas",\n "short_name"
require 'faraday-stack'
client = Faraday.new(url => 'https://graph.facebook.com') do |builder|
builder.request :multipart
builder.request :url_encoded
builder.request :json
builder.use FaradayStack::ResponseJSON, :content_type => /(application|text)\/json/
builder.use FaradayStack::ResponseJSON::MimeTypeFix, :content_type => /text\/(plain|javascript)/
builder.use FaradayStack::FollowRedirects
builder.adapter :net_http
@BrianTheCoder
BrianTheCoder / gist:1572495
Created January 6, 2012 21:34
sample output
~/code/dialexa/Blurtt/Backend/blurtt_backend $ curl -d "access_token=<token>&message=test" -v -L https://graph.facebook.com/8306278/feed
* About to connect() to graph.facebook.com port 443 (#0)
* Trying 69.171.224.22... connected
* Connected to graph.facebook.com (69.171.224.22) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):