JSON
This file contains hidden or 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
class RailsApp < FPM::Cookery::Recipe | |
description 'A rails app' | |
name 'my-rails-app' | |
version '1.0' | |
source '/tmp/foo', :with => :git | |
def build | |
gemhome = Pathname.pwd.join('.gemhome').to_s |
This file contains hidden or 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 'thread' | |
require 'thread_safe' | |
require 'benchmark' | |
core = [] | |
ts = ThreadSafe::Array.new | |
mutex = Mutex.new | |
iterations = 5_000 | |
threads = 1000 |
This file contains hidden or 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 'rubygems' | |
require 'rubygems/package' | |
require 'zlib' | |
require 'fileutils' | |
module Util | |
module Tar | |
# Creates a tar file in memory recursively | |
# from the given path. | |
# |
This file contains hidden or 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
$ jruby -v | |
jruby 1.7.5.dev (1.9.3p392) 2013-09-04 090d5dd on Java HotSpot(TM) 64-Bit Server VM 1.7.0_25-b15 [darwin-x86_64] | |
$ time jruby -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xverify:none -e 'require "rails"' | |
jruby -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xverify:none -e 5.18s user 0.47s system 136% cpu 4.142 total | |
$ time jruby -e 'require "rails"' | |
jruby -e 'require "rails"' 14.60s user 0.44s system 202% cpu 7.444 total |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'json' | |
require 'net/http' | |
require 'net/https' | |
require 'optparse' | |
class CheckPuppetRunHealth | |
def self.run |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This file contains hidden or 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 'puppet' | |
require 'puppet/application' | |
require 'puppet/configurer' | |
Puppet::Util::Log.newdesttype :fpm do | |
def initialize(i) | |
$stderr.sync = true | |
$stdout.sync = true | |
rescue => e | |
puts e.message |
This file contains hidden or 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
# Gitlab installation via puppet on Debian/Ubuntu (quick & dirty) | |
# | |
# Based on https://github.com/gitlabhq/gitlabhq/blob/stable/doc/install/installation.md | |
# | |
# Tested on Ubuntu 12.04. | |
# | |
# Run it: | |
# $ apt-get install puppet | |
# $ puppet apply puppet.pp | |
# |
This file contains hidden or 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 'celluloid' | |
class URLResolver | |
include Celluloid | |
def resolve(num, url) | |
sleep 1 | |
puts "[#{Time.now.to_f}] #{Thread.current.object_id} #{num} Resolving #{url}" | |
end | |
end |