Skip to content

Instantly share code, notes, and snippets.

View chussenot's full-sized avatar

Clément Hussenot chussenot

View GitHub Profile

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.

# Looks for the escaped fragment meta tag. If found, gets the HTML snapshot
# instead
module GoogleBotSimulator::EscapedFragment
def has_meta_fragment?
(@response.search('//meta[@name="fragment"]/@content').to_s == '!') ? true : false
end
def url_with_escaped_fragment(url)
class MyApplication < Sinatra::Base
use Rack::Session::Cookie
use Warden::Manager do |manager|
manager.default_strategies :password
manager.failure_app = MyApplication
end
Warden::Manager.serialize_into_session{ |user| user.id }
$ curl 'https://www.linkedin.com/ta/titleV2?query=editor' -H 'pragma: no-cache' -H 'accept-encoding: gzip, deflate, sdch' -H 'x-requested-with: XMLHttpRequest' -H 'accept-language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36' -H 'accept: */*' -H 'cache-control: no-cache' -H 'cookie: __utma=226841088.932423278.1426009571.1441109315.1455268828.7; __utmv=226841088.user; __utmz=226841088.1455268828.7.6.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); _ga=GA1.2.932423278.1426009571; _lipt=0_2D0HgoiQXLp395TkCpLQ7jRkeK2bNOXEPRTmrAUgK4_7wD_QxuYX_Jd-MIuTR2wAUgo2rtVuUloq03Ls10p3MGUEpnSgWJ-zhHd-iJAonlE3IquOSaa_szQwmPKw0oxqjL1EDeGq9avMcrbMpMpN1VjpnStE2ZRCwyI73eytlMEmtYyW_3Z9SKwAZhvLkz8C8LLWdVknsOKBNzOgWO7OwiyMGM-uwAqIKbNCpJs9M6n6vlZwg3FTRZ8wjkbRlbg2aFyBGo5zgTpb_TrnIKL8a0vYhSl5eNwlb3yjgM2-m9Y2PVTneq2GaqXxJ-ibTkkI8t63xOyPigFw4C9W6BTh0y; bcookie="v=2&2b3293b8-d3cf-4de5-80a8
#
# Symmetric Encryption for Ruby
#
---
# For the development and test environments the test symmetric encryption keys
# can be placed directly in the source code.
# And therefore no RSA private key is required
development: &development_defaults
key: 1234567890ABCDEF1234567890ABCDEF
iv: 1234567890ABCDEF
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
[core]
excludesfile = /Users/chussenot/.gitignore_global
[diff]
color = true
[alias]
; shortcuts
st = status
a = add
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
afee5c053f12c642151ebc5db5a4e7029310afd9