Skip to content

Instantly share code, notes, and snippets.

View deepak's full-sized avatar

Deepak Kannan deepak

View GitHub Profile
fast: through middleware inserted at 0
slwr: through middleware inserted via @use@
rotr: through endpoint sent via the router
bare: through ActionController::Metal with self.response_body
cntr: through ActionController::Base with self.response_body
text: through ActionController::Base with render :text
tmpl: through ActionController::Base with simple render :template
layt: through ActionController::Base with render :template with layout
Note: These tests are being run without ActiveRecord, which currently
We couldn’t find that file to show.
@tmm1
tmm1 / gist:504342
Created August 2, 2010 08:37
rails3 patch for perftools.rb cpu/object profiling
diff --git a/Gemfile b/Gemfile
index fd90d42..9dd0146 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,6 @@
source 'http://rubygems.org'
+gem 'perftools.rb', '>= 0.4.4'
+gem 'rack-perftools_profiler'
gem 'rails', '3.0.0.rc'
@dreamcat4
dreamcat4 / install_rvm.rb
Created August 21, 2010 19:33
Install RVM to /usr/local - as admin group
#!/usr/bin/env ruby
#
# One-liner
# curl -fsS https://gist.github.com/raw/542746/install_rvm.rb | ruby -e '$script=STDIN.read;eval $script'
#
# This script installs to /usr/local only. It assumes theres an
# admin group on your system - either "wheel", "admin", or "staff"
#
# Sudo is used a few times during the initial install. But anyone
# in admin group can manage rvm (regardless of sudo privelidges)
(defun color-theme-njs-wheat ()
"Color theme by Nick Sieger [01/01/09 15:34 NJS] derived from
'wheat'."
(interactive)
(color-theme-wheat)
(color-theme-install
'(color-theme-njs-wheat
((background-color . "#dfdbc3")
(foreground-color . "#3b2322")
(cursor-color . "spring green"))
@gravis
gravis / readme
Created September 26, 2010 17:26
tcp syslog logger for rails draft
tcp_syslog is now a gem :
https://github.com/tech-angels/tcp_syslog
#!/usr/bin/env ruby
require 'test/unit'
CONSTANT = :global
module A
CONSTANT = :lexical
class B
def constant
@spiegela
spiegela / mailing_list.rb
Created October 15, 2010 01:55
So I wanted to create some default options in my parser. I'm not sure if this is how you would do it, but this is what I figured out...
module Burst
class MailingList
include Typhoeus
DEFAULT_KEY = 'SECRET'
DEFAULT_HOST = '127.0.0.1'
DEFAULT_PORT = 3000
remote_defaults :on_success => lambda {|response| Yajl::Parser.parse(response.body)},
:on_failure => lambda {|response| raise "Error code: #{response.code}"},
:base_uri => "http://"
body {
background-color: #000 !important;
}
#statusBar {
background-color: #224 !important;
border-color: #336 !important;
}
#buffers li.server {
# Original blog post about Rubinius performance on the alioth mandelbrot benchmark:
# http://rfc2616.wordpress.com/2010/10/16/rubinius-vs-the-benchmark-from-hell/
#
# Problems with assumptions in the blog post:
# * The C <-> Ruby comparison is apples to oranges because the Ruby code
# is written to use blocks rather than loops. That imposes the overhead
# of additional execution contexts per pixel.
# * The output is written a byte at a time, which requires a fairly deep
# chain of methods before the byte is handed off to the OS.
# * The work is done in the script body. Unless the implementation has