A proof of concept of having Sinatra like routes inside your controllers.
Since the router is gone, feel free to remove config/routes.rb.
Then add the file below to lib/action_controller/inline_routes.rb
inside your app.
| # SSL self signed localhost for rails start to finish, no red warnings. | |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
| #!/usr/bin/env ruby | |
| require 'net/telnet' | |
| require 'lib/trollop' | |
| opts = Trollop::options do | |
| banner <<-EOS | |
| Command line tool to list memcache keys and to get the value of a specific key | |
| Usage: | |
| memcache [options] |
This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |
| require 'rubygems' | |
| require 'redis' | |
| require 'redis/distributed' | |
| r = Redis::Distributed.new %w[redis://host1:6379 redis://host2:6379] | |
| # show node for key "foo" | |
| p r.node_for("foo") | |
| # set the value of "foo" |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| #!/bin/sh | |
| ## | |
| # This is a script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # Run in interactive mode with: | |
| # $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
| # | |
| # or run it without prompt questions: |
| --colour | |
| -I app |
| function verify_app_store_in_app($receipt, $is_sandbox) | |
| { | |
| //$sandbox should be TRUE if you want to test against itunes sandbox servers | |
| if ($is_sandbox) | |
| $verify_host = "ssl://sandbox.itunes.apple.com"; | |
| else | |
| $verify_host = "ssl://buy.itunes.apple.com"; | |
| $json='{"receipt-data" : "'.$receipt.'" }'; | |
| //opening socket to itunes |