Go's concurrency model on top of JRuby
Channel.new creates a channel, and you can optionally pass it a capacity: Channel.new(200)
Use << to send on a channel: chan << "stuff"
| #!/usr/bin/env ruby | |
| class CompleteNaryTreeGenerator | |
| def self.generate_dot(height, degree) | |
| puts 'digraph {' | |
| # Convenience. | |
| d = degree | |
| h = height | |
| i = 1 |
| #!/bin/sh | |
| # Generate n random numbers in [0, 999]. n defaults to 100 but override it with $1. | |
| if [ "$1" == '' ]; then | |
| upto=100 | |
| else | |
| upto=$1 | |
| fi | |
| for i in `seq 1 $upto`; do echo $(($RANDOM % 1000)); done |
| ssh-dss AAAAB3NzaC1kc3MAAACBAIE9R4sFArK2lrn0l0MLRFxn0ExUMIH/4VPg2gQxE9a1KwTr9nbQpL6H+mxxZLNm9+iKZeKrx+PEqNH6SmhYx0LUQ7FqaYhy89Leoy5uUW87CSd9x7KuxBChK9vvqyf8X7b2mGzWgs5XRzSiLHngn8XGHxVgXQoS1K/w7M+c4I2nAAAAFQDEhsSJQOzio1v8Jiy5ypALwxnaswAAAIB7STNNhWdkb7SeHs0zEEkwgs0nExzBFAZ3WAmZZnb8m9HWTLbwZpGGPRfcWi0cthHIwfzATvzUwEZuzjmeqhS9J7UxSaPOpzg4mTSQFvj6ZHzTg+ZwhNIRAOOaXV2lopq9KChV+ZSjtmZQDs6Js0oJEAuw5DCktKTnkZ1Kf8hsfQAAAIBattEuuohpFnTY5VM8B7mMVib1y1jQ0yPa+sORBFqzdGeJxoPZJvGXhO5L90KW20VtLGRbrrkdrZ75/7Cy1mISe6+Of7WBaZniL+kxUN4+hwuw/2aWjgOUstEhFOf3rilinMc/wBtCjpe5GLLEbDTGLAlZbS0/GwS+hh1GLKfdmg== huned@omg |
| # <%= hostname %> | |
| # | |
| # Serves a Rails app via SSL. If nginx finds a rule to handle the request, use | |
| # it; unhandled requests are proxied upstream to a puma server. | |
| # | |
| # Notes: | |
| # | |
| # * Assumes SSL. Non-SSL requests are redirected to their SSL equivalents. | |
| # * Assumes SSL certificate and key at ... | |
| # * Assumes that rails app is served via puma at ... |
| [jgalang@rashomon:~/Code/skunkworks/2fa] | |
| ∴ ruby totp_demo.rb | |
| Time(sec) Time (UTC format) Value of T(Hex) TOTP Mode OK | |
| ------------------------------------------------------------------------------------------ | |
| 59 1970-01-01 00:00:59 0000000000000001 94287082 SHA1 ✔ | |
| 59 1970-01-01 00:00:59 0000000000000001 46119246 SHA256 ✔ | |
| 59 1970-01-01 00:00:59 0000000000000001 90693936 SHA512 ✔ | |
| 1111111109 2005-03-18 01:58:29 00000000023523EC 07081804 SHA1 ✔ | |
| 1111111109 2005-03-18 01:58:29 00000000023523EC 68084774 SHA256 ✔ |
| <!doctype html> | |
| <!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
| <html> | |
| <head> | |
| <title>iOS 8 web app</title> | |
| <!-- CONFIGURATION --> |
| # /config.ru | |
| # This file is used by Rack-based servers to start the application. | |
| # For Rails | |
| require ::File.expand_path('../config/environment', __FILE__) | |
| # For Sinatra | |
| require './slim/slim.rb' | |
| # - Make sinatra play nice | |
| use Rack::MethodOverride |
I build companies + products + high performing teams. I get results. Sometimes I advise startups.
| { | |
| "love": 11.666666666666666, | |
| "music": 8.333333333333332, | |
| "design": 8.333333333333332, | |
| "social": 6.666666666666667, | |
| "creator": 6.666666666666667, | |
| "estate": 5, | |
| "entrepreneur": 5, | |
| "engineer": 5, | |
| "web": 5, |