This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "http/server" | |
module HTTPCluster | |
struct Worker | |
def initialize(@pid : Int32, @master : Int32) | |
end | |
def call(port) | |
yield(port) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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$/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |