Skip to content

Instantly share code, notes, and snippets.

View retgoat's full-sized avatar
💭
😣

Roman retgoat

💭
😣
View GitHub Profile
@retgoat
retgoat / examples
Last active April 27, 2016 09:56
OAuth with Koala
GET http://localhost:3000/fb/fb_code
RESPONSE
{"redirect_url":"https://www.facebook.com/dialog/oauth?client_id=893637180663238\u0026redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Ffb%2Fcallback"}
----
redirect to https://www.facebook.com/dialog/oauth?client_id=893637180663238\u0026redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Ffb%2Fcallback
redirect to callback_url
GET http://localhost:3000/fb/callback?code=FB_AUTH_CODE
RESPONSE
{"access_token":"FB_ACCESS_TOKEN"}
# backported from rails 4 to use inside rails 3
# if you're using rails 4, you do not actually need this.
module ActiveSupport
class Logger < ::Logger
# extend ActiveSupport::TaggedLogging
# Broadcasts logs to multiple loggers. Returns a module to be
# `extended`'ed into other logger instances.
def self.broadcast(logger)
Module.new do
define_method(:add) do |*args, &block|
@retgoat
retgoat / dispatcher.erl
Last active November 2, 2015 06:53 — forked from dry/dispatcher.erl
Moochiweb router example
-module (dispatcher).
-export ([dispatch/2, convert_method_to_action/1]).
dispatch(_,[]) -> none;
dispatch(Req, [{Regexp, Handler}|T]) ->
"/" ++ Path = Req:get(path),
Method = Req:get(method),
@retgoat
retgoat / how-to-install-ruby-oci8.md
Last active August 29, 2015 14:27 — forked from peterhellberg/how-to-install-ruby-oci8.md
Install of ruby-oci8 for 10.9/OSX Mavericks

Install of ruby-oci8 for 10.9/OSX Mavericks - step-by-step:

  1. Go here: http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
  2. Download the 64bit versions of instantclient-sqlplus, instantclient-sdk, instantclient-basic - the 32bit versions do not work with OSX 10.9
  3. Create directories at /opt/oracle
  4. Unzip instantclient-basic first, move to /opt/oracle (should add a folder - something like /opt/oracle/instantclient_11_2/)
  5. Unzip instantclient-sdk and move its contents to /opt/oracle/instantclient_11_2/
  6. Unzip instantclient-sqlplus and move its contents /opt/oracle/instantclient_11_2/
  7. Open Terminal (if you haven't already) and type...
  8. DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 export DYLD_LIBRARY_PATH