Skip to content

Instantly share code, notes, and snippets.

View huned's full-sized avatar
💭
I may be slow to respond.

Huned Botee huned

💭
I may be slow to respond.
View GitHub Profile
@huned
huned / complete_nary_tree.rb
Last active August 29, 2015 14:15
Generates a Complete N-ary Tree given parameters (height, degree) in dot format. Visualize with graphviz.
#!/usr/bin/env ruby
class CompleteNaryTreeGenerator
def self.generate_dot(height, degree)
puts 'digraph {'
# Convenience.
d = degree
h = height
i = 1
@huned
huned / random
Last active August 29, 2015 14:15
#!/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
@huned
huned / id_dsa.pub
Last active August 29, 2015 14:10
huned@omg's public key
ssh-dss AAAAB3NzaC1kc3MAAACBAIE9R4sFArK2lrn0l0MLRFxn0ExUMIH/4VPg2gQxE9a1KwTr9nbQpL6H+mxxZLNm9+iKZeKrx+PEqNH6SmhYx0LUQ7FqaYhy89Leoy5uUW87CSd9x7KuxBChK9vvqyf8X7b2mGzWgs5XRzSiLHngn8XGHxVgXQoS1K/w7M+c4I2nAAAAFQDEhsSJQOzio1v8Jiy5ypALwxnaswAAAIB7STNNhWdkb7SeHs0zEEkwgs0nExzBFAZ3WAmZZnb8m9HWTLbwZpGGPRfcWi0cthHIwfzATvzUwEZuzjmeqhS9J7UxSaPOpzg4mTSQFvj6ZHzTg+ZwhNIRAOOaXV2lopq9KChV+ZSjtmZQDs6Js0oJEAuw5DCktKTnkZ1Kf8hsfQAAAIBattEuuohpFnTY5VM8B7mMVib1y1jQ0yPa+sORBFqzdGeJxoPZJvGXhO5L90KW20VtLGRbrrkdrZ75/7Cy1mISe6+Of7WBaZniL+kxUN4+hwuw/2aWjgOUstEhFOf3rilinMc/wBtCjpe5GLLEbDTGLAlZbS0/GwS+hh1GLKfdmg== huned@omg
@huned
huned / -
Created March 23, 2014 01:14
# <%= 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 ...
@jurisgalang
jurisgalang / totp
Last active November 17, 2017 00:46
Ruby implementation of the Time-Based One-Time Password (TOTP) Algorithm described at http://tools.ietf.org/html/rfc6238
[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 ✔
@michaelfairley
michaelfairley / README.md
Created November 24, 2012 18:01
jruby-go

jruby-go

Go's concurrency model on top of JRuby

Channels

Channel.new creates a channel, and you can optionally pass it a capacity: Channel.new(200)

Use << to send on a channel: chan << "stuff"

<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@thomasyip
thomasyip / config.ru
Created October 26, 2011 05:46
Config.ru for Rails meets Sinatra
# /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
@huned
huned / l101knkKwk.md
Created August 3, 2011 22:33
String#to_markdown

Huned Botee

datanerd + company/team builder

I build companies + products + high performing teams. I get results. Sometimes I advise startups.

Experience

  • Company Builder at Huned Botee (Internet)
  • VP Engineering at Crowdcast (Computer Software)
  • Senior Software Engineer at Swivel (Internet)
  • Project Manager at KickApps (Internet)
@huned
huned / gist:1094999
Created July 20, 2011 13:57
Word frequency (% of tweets in the past week) used by my twitter followers. It's a rough indication of what my twitter followers prattle on about.
{
"love": 11.666666666666666,
"music": 8.333333333333332,
"design": 8.333333333333332,
"social": 6.666666666666667,
"creator": 6.666666666666667,
"estate": 5,
"entrepreneur": 5,
"engineer": 5,
"web": 5,