Skip to content

Instantly share code, notes, and snippets.

View ryanza's full-sized avatar
🎯
Focusing

Ryan Oberholzer ryanza

🎯
Focusing
View GitHub Profile
@ryanza
ryanza / mrd.py
Created May 21, 2018 03:42
Basic mitm attack to change params to allow me to order from diff restaurants with MrD.
def request(flow):
if flow.request.url.startswith('https://api.mrdfood.com/landing-items'):
flow.request.query["latitude"] = -33.9056222
flow.request.query["longitude"] = 18.596244
@ryanza
ryanza / .rvmrc
Created July 6, 2011 08:50
Use 1.9.2 faster require patch (if installed) or default to normal 1.9.2
if rvm list strings | grep -q "ruby-1.9.2-p180-patched" ; then
rvm use ruby-1.9.2-p180-patched
else
rvm use ruby-1.9.2-p180
fi
def self.active_roles
active_roles = Model::ROLES_MASK
[:deleted, :roles].each do |dr|
active_roles.delete(dr.to_s)
end
active_roles
end
# User: has_many :debtors
# Debtor: belongs_to :user
user = User.where(:name => "Bob").first
user.debtors.all.delete_all
# The above command deleted ALL the debtors in the DB?
%p.normal
%label{ :for => "statusboard_url" } Statusboard URL
%input.text#statusboard_url{ :name => "notifiers[Statusboard][url]", :type => "text", :value => config["url"] }
<?php
global $memcache_obj;
global $memcache_key;
global $html;
$server = 'localhost';
$port = '11211';
$protocol = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$memcache_key = md5($protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'|'.serialize($_POST).'|'.serialize($_SESSION));