Skip to content

Instantly share code, notes, and snippets.

View cs3b's full-sized avatar

Michał Czyż cs3b

  • CS3B
  • Wisła, Poland
  • X @cs3b
View GitHub Profile
@coldnebo
coldnebo / rails_trace.rb
Last active August 15, 2024 15:15
This Rack middleware for Rails3 lets you see a call-trace of the lines of ruby code in your application invoked during a single request. Only code within your app is considered (i.e. in the /app folder). This expands on my previous attempt (https://gist.github.com/3077744). Example of output in comments below.
require 'singleton'
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code
# invoked during a single request.
#
# Example:
#
# 1) Make sure this file is loaded in an initializer
#
# 2) Add the following to your application.rb in Rails3:
@bartlomiejdanek
bartlomiejdanek / pry-incremental-search-fix
Created November 28, 2012 09:30
ruby 1.9.3 iterm2 pry
$ rvm pkg install readline --verify-downloads 1
$ rvm install 1.9.3 --with-readline-dir=$rvm_path/usr --force
$ gem install pry
$ $ pry
(reverse-i-search)`':
[2] pry(main)>
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: