Skip to content

Instantly share code, notes, and snippets.

View paul's full-sized avatar

Paul Sadauskas paul

View GitHub Profile
$ cat ~/.rspec
--color
--fail-fast
--backtrace
--format documentation

Transcript of http://www.youtube.com/watch?v=bzkRVzciAZg

p1: And in conclusion we have found apache to be an excellent server for our web applications. Any questions?

p2: Yes, I have a question. Why didn't you use node.js? node.js is an event driven, non-blocking IO server that can be used to build high-performance web applications

p1: That is an excellent queiston. We evaluated several alternative webservers and concluded, that while options like node.js are very interesting, Apache meets our needs and has a solid track record.

p2: But it doesn't have performance. Everybody knows that apache applications are slow because they use blocking IO and have context switches.

@paul
paul / gold_plating.rb
Last active March 15, 2016 22:45
An implementation of the Conductor Pattern
module GoldPlating
extend ActiveSupport::Concern
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
included do
extend ActiveModel::Callbacks
define_model_callbacks :validation
LETTERS = "abcdefghijklmnopqrstuvwxyz".split('')
def base_alpha_26(int)
num = int
letters = []
i = 0
i += 1 until 26**i > int
while (i -= 1) >= 0;
Viz.WidgetsController = Ember.ArrayController.extend
init: ->
@refresh()
setInterval (=> @refresh()), 5000
refresh: ->
$.ajax
url: @get('src'),
type: "GET",
context: this,
# ZSH Theme - Preview:
local ob='%{$fg[blue]%}[%{$reset_color%}'
local cb='%{$fg[blue]%}]%{$reset_color%}'
local current_dir='%{$fg[green]%}%~'
local rvm_ruby='%{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt i v g)%{$reset_color%}'
local git_branch='$(git_prompt_info)'
PROMPT="${ob}${current_dir}${cb}${ob}${rvm_ruby}${cb}${git_branch}
# A sample Gemfile
source "http://rubygems.org"
gem "rbench"
gem "mongomatic"
gem "bson_ext"
gem "activerecord"
gem "sequel"
gem "pg"
| Active Record (3.2.0.rc1) mysql | Active Record (3.2.0.rc1) mysql-2 | Sequel mysql | Sequel mysql-2 |
-------------------------------------------------------------------------------------------------------------------------------------------
insert x1000 | 0.896 | 0.810 | 0.883 | 0.809 |
select 1000 records x1000 | 34.637 | 81.096 | 0.017 | 0.016 |
post = Post.detect { |p| p.author == some_author } # GET /posts?author_href=/authors/1234
posts = Post.select { |p| p.q == "Stuff" } # GET /posts?q=Stuff
posts = Post.select { |p| p.title == "Stuff" } # GET /posts (since `title` isn't an available query param, fall back to Enumerable#select)
post = Post.get("http://api.ls.com/posts/1")
posts = Post.get_collection("http://api.ls.com/posts/1")
posts = Post.get_collection(Service.discover("AllPosts"))
posts = Post.get_collection() # auto-discovers based on service_name/uri
# Given service_uri = /posts{?author_href}
/*
As of version 1.1.2, Propane will load and execute the contents of
~/Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.