start new:
tmux
start new with session name:
tmux new -s myname
| class Wadus | |
| def call(env) | |
| ['200', {'X-Wadus' => 'Foo'}, ['Rack app with config.ru file']] | |
| end | |
| end | |
| run Wadus.new |
| #!/usr/bin/env ruby | |
| # Put this file in the root of your Rails project, | |
| # then run it to output the SQL needed to change all | |
| # your tables and columns to the same character set | |
| # and collation. | |
| # | |
| # > ruby character_set_and_collation.rb | |
| DATABASE = '' |
| ;(function($, undefined) { | |
| 'use strict'; | |
| if (typeof window.MY_MODULE_NAME !== 'undefined') { | |
| return; | |
| } | |
| // | |
| // Module general vars | |
| // |
| class Dummy::TimeMachine | |
| def initialize(app) | |
| @app = app | |
| end | |
| def call(env) | |
| Rails.logger.info("[TimeMachine] Starting time travel.") | |
| Timecop.return | |
| request = Rack::Request.new(env) | |
| params = request.params |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <yahoo-weather-codes> | |
| <code number="0" description="tornado"/> | |
| <code number="1" description="tropical storm"/> | |
| <code number="2" description="hurricane"/> | |
| <code number="3" description="severe thunderstorms"/> | |
| <code number="4" description="thunderstorms"/> | |
| <code number="5" description="mixed rain and snow"/> | |
| <code number="6" description="mixed rain and sleet"/> | |
| <code number="7" description="mixed snow and sleet"/> |
| def confirmation(credentials) | |
| return false if params['ds_signature'].blank? | |
| # The DES3-CBC key generation it's the same that in the creation gist | |
| # You can take a look at the explanation | |
| secret_key = credentials[:secret_key] | |
| secret_key_base64 = Base64.strict_decode64(secret_key) | |
| des3 = OpenSSL::Cipher::Cipher.new('des-ede3-cbc') | |
| block_length = 8 | |
| des3.padding = 0 |