I hereby claim:
- I am marcinbunsch on github.
- I am marcinbunsch (https://keybase.io/marcinbunsch) on keybase.
- I have a public key whose fingerprint is 1836 25CF 5835 7135 7C96 B578 7139 5EA3 254C 76F4
To claim this, I am signing this object:
class Wat | |
attr_accessor :collaborator, :credentials | |
def foo(arg) | |
@collaborator.foo(arg) | |
rescue | |
@collaborator.set_auth_credentials(credentials) | |
@collaborator.foo(arg) | |
end |
#!/usr/bin/env ruby | |
# | |
# OMG THIS CODE IS SO UGLY | |
# but... | |
# IT WORKS!! | |
# | |
# Hacked together by http://github.com/marcinbunsch | |
# | |
# This assumes the following: | |
# - That you're on a Mac |
# Put this file in config/initializers/irb.rb | |
# Works in Rails 3.0+, should also work in 2.3 | |
# Override the IRB, to provide the Rails environment in the prompt | |
module IRB | |
class << self | |
def setup_with_prompt_override(ap_path) | |
setup_without_prompt_override(ap_path) | |
env = (Rails.env.to_sym == :production ? "\033[00;31mPRODUCTION\033[00m" : Rails.env) |
I hereby claim:
To claim this, I am signing this object:
const express = require("express"); | |
const app = express(); | |
const bodyParser = require('body-parser'); | |
const options = {}; | |
app.use(bodyParser.json()); // for parsing application/json | |
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded | |
app.post('/groove/ticket/assign', function(req, res) { | |
console.log(req.body) |
// How to use this: | |
// 1. Go to the desired profile page on coderwall, like http://coderwall.com/marcinbunsch | |
// 2. Paste this gist in the JS console | |
// | |
// You can also probably use this in greasemonkey and dot.js | |
// | |
// Also, it was tested in Chrome, Firefox and Safari, it probably will | |
// not work in IE, but I just don't care about it ;) | |
// | |
// UPDATE: Coderwall made changes to the site and I cannot retrieve the achievements, so they are hardcoded, taken from a cached version of the achievements page |
# You can use this class in your console. For example | |
# p = ProfilingTools.new | |
# p.profiled_request(:controller => :welcome, :action => :index) | |
# this will profile whole application stack and save file in your tmp/profiler folder | |
# You can also use +request+ method just to see the output for example: | |
# | |
# p.request(:controller => :offers, :action => :index) | |
# | |
# p.response.body | |
# p.response.cookies # and so on |