Skip to content

Instantly share code, notes, and snippets.

View rmoriz's full-sized avatar
🎭
Everything counts in large amounts

rmoriz

🎭
Everything counts in large amounts
View GitHub Profile
@vjt
vjt / INSTALL.txt
Created January 28, 2009 12:01
lighthouse-github integration
# Assuming you're on Ubuntu or OSX
#
GIT=$(dirname `which git`)
sudo install -m 755 git-lh.rb $GIT/git-lh
sudo install -m 755 git-lh-push.sh $GIT/git-lh-push
#!/usr/bin/env ruby
require File.expand_path('../config/environment', __FILE__)
require 'cramp'
require 'cramp/controller'
Cramp::Controller::Websocket.backend = :thin
class SyncroLongPollSubscribe < Cramp::Controller::Action
on_start :post_init
on_finish :unbind
@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
# this file is controlled by Chef
# feel free to copy it to your ~/.tmux.conf
unbind C-a
set -g prefix C-a
bind C-a send-prefix
set -g default-terminal screen-256color
setw -g xterm-keys on
set -g status-utf8 on
class ApplicationController < ActionController::Base
...
# FORCE to implement content_for in controller
def view_context
super.tap do |view|
(@_content_for || {}).each do |name,content|
view.content_for name, content
end
end
end
@mschmitt
mschmitt / check.pl
Created June 8, 2011 11:36
IPv6-Erhebung am Hochtechnologiestandort Deutschland.
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Net::DNS;
print "IPv6-Erhebung am Hochtechnologiestandort Deutschland.\n\n";
print "Es wurden die Homepages der DAX-Unternehmen auf IPv6-Support untersucht.\n\n";
printf "%-35s %s\n", 'Hostname', 'IPv6-Adresse';
printf "%-35s %s\n", '--------', '------------';
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@jamesu
jamesu / Capfile.rb
Created June 23, 2011 21:47
Deploying chef with capistrano
# Deploying chef with capistrano
# Requires a typical chef config layout, i.e.
# cookbooks/
# nodes/
# roles/
#
# Commands:
# configure:<node> - Upload chef cookbooks, run chef-solo
#
# Roles will automatically be added from nodes/*.json. e.g. if you have
@cicloid
cicloid / ubuntu-11.10-gems.erb
Created October 28, 2011 22:49
Ubuntu 11.10 Chef Bootstrap with RBEnv
bash -c '
<% if knife_config[:bootstrap_proxy] -%>
(
cat <<'EOP'
<%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
EOP
) > ~/.curlrc
<% end -%>
if [ ! -f /usr/bin/chef-client ]; then
@kommen
kommen / 0-readme.md
Created February 28, 2012 21:23 — forked from mickm/0-readme.md
ruby-1.9.3-p125 cumulative performance patch, with Xcode 4.3 command line tools compatible.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

It works with Xcode 4.3 and the clang compiler it ships with its command line tools package.

Huge thanks to funny-falcon for the performance patches.