Skip to content

Instantly share code, notes, and snippets.

require "http/server"
module HTTPCluster
struct Worker
def initialize(@pid : Int32, @master : Int32)
end
def call(port)
yield(port)
end
require "big_int"
struct BigInt2 < Int
def initialize(num : Int::Signed)
if LibC::Long::MIN <= num <= LibC::Long::MAX
LibGMP.init_set_si(out @mpz, num)
else
LibGMP.init_set_str(out @mpz, num.to_s, 10)
end
end
FROM my/base
VOLUME ["/app/vendor/cache"]
ADD ./docker /app/docker
RUN if [ -f /app/docker/setup.sh ]; then /app/docker/setup.sh; fi
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
@benoist
benoist / Guardfile
Last active November 8, 2015 11:22
Crystal guard file
# gem install guard
# gem install guard-process
guard 'process', :name => 'Spec', :command => 'crystal spec' do
watch(/spec\/(.*).cr$/)
watch(/src\/(.*).cr$/)
end
guard 'process', :name => 'Build', :command => 'crystal build app.cr' do
watch(/src\/(.*).cr$/)
@benoist
benoist / better_logger.rb
Created September 10, 2011 07:44 — forked from indirect/better_logger.rb
Rails 3 logs with severity and PIDs
# You must require this file in application.rb, above the Application
# definition, for this to work. For example:
#
# # PIDs prepended to logs
# if Rails.env.production?
# require File.expand_path('../../lib/pid_logger', __FILE__)
# end
#
# module MyApp
# class Application < Rails::Application