Skip to content

Instantly share code, notes, and snippets.

View gbelote's full-sized avatar
🎩
Workin' on Wefunder

Greg Belote gbelote

🎩
Workin' on Wefunder
View GitHub Profile
ruby:
config_file: .rubocop.yml

Homebrew Formula patching old ImageMagick release 6.7.7-10

Install

$ brew install https://gist.githubusercontent.com/gbelote/825a335de7b9c45dc772/raw/5f528e2fb841118cbb9b22665f8f673b7d8ff91b/imagemagick.rb

Tested

Keybase proof

I hereby claim:

  • I am gbelote on github.
  • I am gbelote (https://keybase.io/gbelote) on keybase.
  • I have a public key whose fingerprint is 6C4C DD20 F87A 9051 7743 CC01 7BEA 0D5E 67A3 FE6D

To claim this, I am signing this object:

1) Open https://staging.wefunder.com/ and run tokenize in the console (via copy/paste). Grab the resulting URI
2) Run associate.rb with the balanced 0.7.0 gem from github (as of yesterday):
URI="... uri from tokenize.js ..." BALANCED_MARKETPLACE_URI="..." BALANCED_SECRET_KEY="..." ruby associate.rb
balanced_uri = "..." # stored when bank account created. this has also been verified.
account = Balanced::BankAccount.find balanced_uri
account.debit( appears_on_statement_as: "Test Balanced Debit", amount: 1, description: "This is a test debit in the console!" )
class SomeController < ApplicationController
# params either looks like...
# params = { login: { email: "foo@example.com", password: "bar" } }
# params = { new_user: { email: "foo@example.com", full_name: "Soo Moo", password: "bar" } }
def some_endpoint
@user = User::SignupOrLoginService.new(params, request.remote_ip).auth
render json: @user
end
end
@gbelote
gbelote / configinitializersz_thread_sweeper.rb
Created September 30, 2012 12:51
Fix NewRelic+Webrick memory leak
class ZThreadSweeper
def initialize(app)
@app = app
end
def call(env)
pre_keys = Thread.current.keys
result = @app.call(env)
post_keys = Thread.current.keys
<!DOCTYPE html>
<html>
<head>
<meta name = "viewport" content = "width = 1200">
<title>Crowd Investing | Wefunder</title>
<link href="//wefunder.com/assets/application-5f36b3f1804f3b48f3eec6026b556e7c.css" media="all" rel="stylesheet" type="text/css" />
<script src="//wefunder.com/assets/application-b38a13eedfca2edd8d2f7bc5bf3a96c8.js" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
diff --git a/spec/lib/facebook/graph_api_spec.rb b/spec/lib/facebook/graph_api_spec.rb
index 7cbbc2c..cafcab9 100644
--- a/spec/lib/facebook/graph_api_spec.rb
+++ b/spec/lib/facebook/graph_api_spec.rb
@@ -19,4 +19,18 @@ describe Facebook::GraphApi do
page_name.should == 'LaunchWare Inc.'
end
+ context "#token_can_post?" do
+ # magic happens in VCR...
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index 1562f4b..8e2221c 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -20,6 +20,12 @@ configatron.facebook.secret_key = fb_keys[:secret_key]
Rails.application.config.facebook = configatron.facebook
FacebookDialog.api_key = Rails.application.config.facebook.api_key
+if Rails.env.development?
+ # deal with cert issues