Skip to content
View sinatra_warden.rb
class MyApplication < Sinatra::Base
use Rack::Session::Cookie
use Warden::Manager do |manager|
manager.default_strategies :password
manager.failure_app = MyApplication
Warden::Manager.serialize_into_session{ |user| }
View escaped_fragment.rb
# Looks for the escaped fragment meta tag. If found, gets the HTML snapshot
# instead
module GoogleBotSimulator::EscapedFragment
def has_meta_fragment?
('//meta[@name="fragment"]/@content').to_s == '!') ? true : false
def url_with_escaped_fragment(url)

Rocky Mountain Ruby

SOA from the Start - Workshop Part

What will we show

We are building a set of applications that have will show deals (aka. 'inventory items') available in or near a given city. These items can also be organized by a 'category' (aka. tags), to cater to the various customers' areas of interest.

To bootstrap things, and to get us focussed on some key areas of developing in a SOA, we have gone ahead and built these apps out at varying stages. The workshops will focus on showing some of this code, and intersperse exercises to add features, or to refactor.

View cursor_helper.rb
module Api
module V2
module Util
module CursorHelpers
extend ActiveSupport::Concern
# apply cursor-based pagination to a collection
# returns a hash:
# results: (paginated collection subset)
# next: (cursor to the next page)
View Reload Grape API in Dev Env.rb
File: config/application.rb
config.autoload_paths += %W(#{config.root}/app/api #{config.root}/app/api/*/*)
File: config/environments/development.rb
# Add below code before DummyApp::Application.configure BLOCK

A Working configuration to setup HTML5 push-state routing in your AngularJS app with Nginx as your web server.

View gist:c5e13508365b44e1d108
require 'net/http'
require 'json'
uri = URI("")
payload = {
'description' => "My test gist",
'public' => true,
'files' => {
'test.txt' => {
View gist:dc4305ba20b11a3e53ac
2.1.1|chussenot:~/Sites/bluporter(spk-fix_spec_helper) $ rspec
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/simplecov-html-0.8.0/lib/simplecov-html.rb:58: warning: possibly useless use of a variable in void context
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/gaston-0.6.0/lib/gaston/configuration.rb:26: warning: method redefined; discarding old env=
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/array.rb:45: warning: shadowing outer local variable - encoded
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/binary.rb:110: warning: shadowing outer local variable - encoded
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/code.rb:86: warning: shadowing outer local variable - encoded
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/code_with_scope.rb:93: warning: shadowing outer local variable - encoded
View Load tests and

Load Tests

Loader IO is a free load testing service that allows you to stress test your web-apps/apis with thousands of concurrent connections.

Gatling Gatling is a stress tool. Development is currently focusing on HTTP support.

View .bash_aliases
alias be="bundle exec"
alias ll="ls -la"
alias g='git'
Something went wrong with that request. Please try again.