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
@@ -27,6 +27,7 @@ namespace :docker do | |
pids = [] | |
forks.times do |i| | |
pids << fork do | |
+ begin | |
## | |
# Configure your environment | |
# You'll want to do something here to make the environment | |
@@ -49,7 +50,9 @@ namespace :docker do |
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
namespace :docker do | |
desc "Run tasks in parallel using docker" | |
task :test do | |
forks = 4 | |
begin | |
# Start docker containers (serially, docker seems to have problems with concurrency) | |
ports = {} | |
forks.times do |i| | |
# Start redis and get the mapped port | |
`docker run -d -p 6379 -name redis#{i} yourdockeruser/redis` |
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
1000 | MA | |
---|---|---|
1001 | GRO-CPGA | |
1005 | BTO | |
1006 | CL | |
1007 | CHEBI | |
1008 | DDANAT | |
1009 | DOID | |
1010 | EMAP | |
1011 | IEV | |
1012 | ECO |
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 'ostruct' | |
require 'benchmark' | |
COUNT = 10_000_000 | |
NAME = "Test Name" | |
EMAIL = "[email protected]" | |
class Person | |
attr_accessor :name, :email | |
end |
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 'benchmark' | |
COUNT = 10_000_000 | |
NAME = "Test Name" | |
EMAIL = "[email protected]" | |
class Person | |
attr_accessor :name, :email | |
def set_with_hash(options = {}) |
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
Content-Type: multipart/mixed; boundary=OntologiesAPIMultipartPost; type=application/json; start=json | |
Content-Length: 328853 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
package main | |
import "github.com/palexander/goumls" | |
import "log" | |
func main() { | |
// Filters for queries | |
rxnorm := toEntries("RXNORM") | |
rxnormTTY := toEntries("IN", "BN") | |
expandedTTY := toEntries("AB", "PT", "SY") |
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
def time_code(name, &block) | |
t1 = Time.now | |
yield | |
puts "#{name}: #{(Time.now - t1).to_f.round(2)}s" | |
end | |
def time_code_aggregate(name, &block) | |
unless @tc_at_exit | |
at_exit do | |
@tc_timers.each do |name, time| |
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
#!/bin/bash | |
# Install Spark on CentOS 7 | |
yum install java -y | |
java -version | |
yum install wget -y | |
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz | |
tar xvf scala-2.11.7.tgz | |
sudo mv scala-2.11.7 /usr/lib | |
sudo ln -s /usr/lib/scala-2.11.7 /usr/lib/scala |