This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InstagramPrivateController < ApplicationController | |
def initialize(username, password, photo, caption) | |
@username = username | |
@password = password | |
@photo = photo | |
@caption = caption | |
@cookiepath = Tempfile.new('cookies').path | |
@user_agent = generate_user_agent() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// snippet is for http://abdullin.com/journal/2011/6/26/event-sourcing-a-la-lokad.html | |
// simple helper, that looks up and calls the proper overload of | |
// When(SpecificEventType event). Reflection information is cached statically | |
// once per type. | |
public static class RedirectToWhen | |
{ | |
static class Cache<T> | |
{ | |
public static readonly IDictionary<Type, MethodInfo> Dict = typeof(T) |