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.
| ] wc -l domains.txt | |
| 783 domains.txt | |
| ] time go run domain_lookup_parallel.go | |
| real 0m5.743s | |
| user 0m0.359s | |
| sys 0m0.355s | |
| ] time go run domain_lookup_sequential.go |
| $VERBOSE = nil | |
| require File.expand_path('../rooby', __FILE__) | |
| Person = Rooby::Class.new 'Person' do | |
| define :initialize do |name| | |
| @name = name | |
| end | |
| define :name do |
| import sys | |
| import colorsys | |
| from colorz import colorz | |
| WALLPAPER = '/home/james/.wallpaper' | |
| COLORS = '/home/james/.colors' | |
| XRESOURCES = '/home/james/.Xresources' | |
| cols = '' | |
| xres = """ |
| require 'fileutils' | |
| # Warning: The following deploy task will completely overwrite whatever is currently deployed to Heroku. | |
| # The deploy branch is rebased onto master, so the push needs to be forced. | |
| desc "Deploy app to Heroku after precompiling assets" | |
| task :deploy do | |
| deploy_branch = 'heroku' | |
| remote = 'heroku' | |
| deploy_repo_dir = "tmp/heroku_deploy" |
| # Here's a contrived example of a LEFT JOIN using ARel. This is an example of | |
| # the mechanics, not a real-world use case. | |
| # NOTE: In the gist comments, @ozydingo linked their general-purpose ActiveRecord | |
| # extension that works for any named association. That's what I really wanted! | |
| # Go use that! Go: https://gist.github.com/ozydingo/70de96ad57ab69003446 | |
| # == DEFINITIONS | |
| # - A Taxi is a car for hire. A taxi has_many :passengers. | |
| # - A Passenger records one person riding in one taxi one time. It belongs_to :taxi. |
I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):
For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.
| require "rubygems" | |
| require "bundler/setup" | |
| # require your gems as usual | |
| require "fog" | |
| require 'fog/aws/glacier' | |
| aws_access_key_id = "??" |
| $stack, $draws = [], {} | |
| def method_missing *args | |
| return if args[0][/^to_/] | |
| $stack << args.map { |a| a or $stack.pop } | |
| $draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
| end | |
| class Array | |
| def +@ |
| # 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 |