Skip to content

Instantly share code, notes, and snippets.

Molly Struve mstruve

Block or report user

Report or block mstruve

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View yay.rb
respond_to do |format|
format.json { render :json => { :success => true, :message => 'yay' } }
mstruve / redis.rb
Created Nov 16, 2018
Redis Readonly Console
View redis.rb
if ENV['REDIS_ACCESS_MODE'] == 'readonly'
class Redis
class Client
WRITE_COMMANDS = { |a| a[0] if a[2].include?('write') }.compact.to_set.freeze
def process(commands)
if commands.flatten.any? { |c| WRITE_COMMANDS.include?(c.to_s) }
raise NotImplementedError, "REDIS_ACCESS_MODE is set to 'readonly', disallowing writes"
View api.rb
before do
client = headers["Auth-Token"])
error!('Unauthorized. Invalid token.', 401) unless client
error!('Unauthorized action.', 403) unless client.user_authorization_required? &&["X-Grpn-Email"]).authorized_action?(request.request_method)
mstruve / educations_controller.rb
Created Aug 24, 2012
Two Examples of methods that parse data from LinkedIn in order to get the Job and Education information for a user.
View educations_controller.rb
def linkedin
client ="API Key", "Secret Key")
client.authorize_from_access(current_user.link_token, current_user.link_secret)
#breakdown LinkedIn Hash into pieces in order to obtain data
@profile = client.profile
@school = client.profile(:fields => %w(educations))
@schools ={|t| t}
You can’t perform that action at this time.