Skip to content

Instantly share code, notes, and snippets.

View tors's full-sized avatar
:octocat:

Tors tors

:octocat:
  • Vim
View GitHub Profile
#! /bin/bash
# /etc/init.d/gitlab
# GITLAB
# Maintainer: @randx
# App Version: 3.0
### BEGIN INIT INFO
# Provides: gitlab

The premise of this exercise is contained in Daniel Himelein's quote:

"The first thing I always do when playing around with a new software platform is to write a concurrent "Hello World" program. The program works as follows: One active entity (e.g. thread, Erlang process, Goroutine) has to print "Hello " and another one "World!\n" with the two active entities synchronizing with each other so that the output always is "Hello World!\n". Here is the concurrent Hello World program in Go, Erlang and in C++ using the Mindroid framework."

Original post

Here is a Hello World example in Ruby/Celluloid. Five, actually.

@tors
tors / deploy.rb
Created February 27, 2013 10:49 — forked from koenpunt/deploy.rb
set :user, "deploy"
set :runner, "deploy"
set :application, "example.com"
set :deploy_to, "/var/apps/#{application}"
set :shared_children, %w(sockets)
set :scm, :git
set :repository, "git@github.com:example.git"
set :deploy_via, :remote_cache
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require "minitest/autorun"
require "minitest/rails"
require "minitest/rails/capybara"
require "database_cleaner"
require "factory_girl"
require "carrierwave/test/matchers"

Setup new Mac with OSX Lion from scratch

These commands are good as of 2011-07-27.

Install xcode 4

App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.

# test/support/custom_capybara_expectations.rb
module CustomCapybaraExpectations
def has_flash_message?(message)
within '#flash' do
has_content? message
end
end
end
Capybara::Session.send :include, CustomCapybaraExpectations
CustomCapybaraExpectations.public_instance_methods(false).each do |name|
@tors
tors / mixins.scss
Created August 10, 2012 06:06 — forked from jpmckinney/mixins.scss
CSS3 SCSS Mixins
// blog post: http://blog.slashpoundbang.com/post/15096433153/css3-scss-mixins
// Mixins ----------------------------------------------------------------------
// http://css3please.com/
@mixin background-rgba($red, $green, $blue, $opacity, $rgba) {
background-color: transparent;
background-color: rgba($red, $green, $blue, $opacity);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$rgba}',endColorstr='#{$rgba}');
zoom: 1;
}
@tors
tors / deploy.rb
Created August 3, 2012 06:57 — forked from mrrooijen/deploy.rb
Capistrano with Foreman Capfile
# encoding: utf-8
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
set :application, "hirefireapp"
set :repository, "git@codeplane.com:meskyanichi/myapp.git"
set :branch, "develop"
set :rvm_ruby_string, "1.9.2"
@tors
tors / facebook_oauth.rb
Created June 20, 2012 05:52 — forked from t-kashima/facebook_oauth.rb
SinatraとOAuthとFacebook
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'koala'
configure do
APPLICATION_ID = "facebook_application_id"
APPLICATION_SECRET = "facebook_application_secret"
set :sessions, true