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 list | cut -d" " -f1 | xargs gem uninstall -aIx |
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
daemon off; | |
worker_processes 6; | |
user nobody nobody; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
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
As the nightly build will fail with nginx-gridfs, we have to compile mongodb | |
from scratch and use the fresh libmongoclient.a version. | |
1) Install neccessary dependencies for Ubuntu | |
apt-get -y install tcsh git-core scons g++ | |
apt-get -y install libpcre++-dev libboost-dev libreadline-dev libmozjs-dev | |
2) Get the source from github and compile it (Note we do not need to run scons | |
install, because we only need the libmongoclient.a) |
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
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib")) | |
require "rubygems" | |
require "benchmark" | |
require "mongoid" | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("mongoid_perf_test", :logger => Logger.new($stdout, :info)) | |
end | |
Mongoid.master.collection("people").drop |
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
#!/usr/bin/env ruby | |
while (input = STDIN.read) != '' | |
rev_old, rev_new, ref = input.split(" ") | |
url = nil | |
if ref == "refs/heads/master" | |
url = "http://172.23.0.150:8080/job/Project%20Master/build" | |
elsif ref == "refs/heads/other-branch" | |
url = "http://172.23.0.150:8080/job/Project%20Other/build" |
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
# it is forked from https://github.com/xijo/reverse-markdown/blob/master/reverse_markdown.rb | |
require 'rexml/document' | |
require 'benchmark' | |
include REXML | |
include Benchmark | |
class ReverseMarkdown | |
# set basic variables: | |
# - @li_counter: numbering list item (li) tags in an ordered list (ol) |
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
var images = document.getElementsByTagName('img'); | |
var image; | |
for (var i = 0; i < images.length; i++) { | |
image = images[i]; | |
image.removeAttribute("width"); | |
image.removeAttribute("height"); | |
} |
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
Gems: | |
gem 'cucumber' | |
gem 'cucumber-rails' | |
gem 'rspec' | |
gem 'rspec-rails' | |
gem 'capybara' | |
gem 'database_cleaner' | |
gem 'spork' | |
gem 'watchr' |
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
################################################################################### | |
# please add the following codes to .git/hooks/commit-msg, make it be an executable | |
################################################################################### | |
#!/usr/bin/env ruby | |
commit_message = File.read ARGV[0] | |
unless commit_message =~ /ENGINEERING-\d+/ | |
puts "ERROR: please add jira ticket on git commit message" | |
exit(1) |
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
#!/usr/bin/env ruby | |
`git diff-index --name-only --cached HEAD`.split("\n").each do |filename| | |
File.open(filename) do |file| | |
while line = file.gets | |
if line.include?("<<<<<<<") || line.include?(">>>>>>>") | |
puts "ERROR: #{filename} is conflict" | |
exit(1) | |
end | |
end | |
end |