It's a twitter-like GitHub browser. I've made it the last weekend for me but seems to be something cool for some people.
It's a place where I can discuss stuff of the app
| require 'cuba' | |
| require 'rack/async' | |
| queue = Queue.new | |
| class Async | |
| def initialize(queue) | |
| @queue = queue | |
| end |
| # Fix Psych Warnings and failures | |
| brew install libyaml | |
| rvm reinstall ruby-1.9.2 --with-libyaml-dir=/usr/local |
| #!/usr/local/bin/ruby | |
| # encoding: UTF-8 | |
| require 'rubygems' | |
| gem 'mechanize' | |
| gem 'main' | |
| gem 'highline' | |
| gem 'money' | |
| gem 'change_watcher' |
| IO.popen('./test') do |io| | |
| begin | |
| while line = io.readline do | |
| send_data line | |
| end | |
| rescue EOFError => e | |
| end | |
| end |
| location / { | |
| if ($request_method = 'OPTIONS') { | |
| add_header 'Access-Control-Allow-Origin' '*'; | |
| add_header 'Access-Control-Allow-Methods' 'POST, OPTIONS'; | |
| add_header 'Access-Control-Max-Age' '1728000'; | |
| add_header 'Content-Type' 'text/plain; charset=UTF-8'; | |
| return 200; | |
| } | |
| } |
| # Autoload .env files | |
| load_env_file() { | |
| if [ -f ".env" ]; then export $(grep -v '#' .env); fi; | |
| } | |
| # Load for .env files when changing dir | |
| chpwd() { load_env_file } |
| # Running benchmarks: | |
| Minuteman 1 10 100 1000 10000 | |
| bench_AND 0.000838 0.000279 0.000287 0.000319 0.000307 | |
| bench_MINUS 0.000393 0.000490 0.000513 0.000491 0.000510 | |
| bench_NOT 0.000273 0.000269 0.000320 0.000353 0.000685 | |
| bench_OR 0.000363 0.000282 0.000356 0.000330 0.000326 | |
| bench_XOR 0.000263 0.000277 0.000308 0.000306 0.000358 | |
| bench_complex_operations 0.000389 0.000507 0.000505 0.000600 0.000725 |
| package main | |
| import( | |
| "fmt" | |
| "math/rand" | |
| "time" | |
| ) | |
| func random(min, max int) int { | |
| rand.Seed(time.Now().Unix()) | |
| return rand.Intn(max - min) + min |
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| %w(json open-uri).each { |lib| require lib } | |
| abort "Usage: #{File.basename __FILE__} [query]" unless ARGV.first | |
| response = open("http://domai.nr/api/json/search?q=#{ARGV.first}").read | |
| JSON.parse(response)["results"].each do |domain| |