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 | |
# Build a map of component names to paths - conveniently, there's a file | |
# already containing that information | |
def build_component_map() | |
text = File.read("#{ENV['HOME']}/projects/sombrero/components/index.js") | |
text.lines.reduce({}) do |res, line| | |
if /^\s+(\w+):\s*require\(\'\.([^']*)/ =~ line | |
key = $1 | |
path = "sombrero/components#{$2}" |
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
let startIndex = 0; | |
const pageSize = 200; | |
let promises = []; | |
while (startIndex < watches.length) { | |
promises.push(AlmApi.query('/artifact/', { | |
query: buildUUIDQuery(uuids.slice(startIndex, startIndex + pageSize)), | |
fetch: fetchFields, | |
pagesize: pageSize |
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
DE25845 { | |
db.name = System.env.DB_NAME ?: 'DE25845' | |
jdbc { | |
user.name = db.name | |
password = db.name | |
service.name = System.env.JDBC_SERVICE_NAME ?: '@//bld-engdb-02:1530/okidb11' | |
} |
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
# Start one task | |
# Returns a promise | |
start_task = (env) -> | |
deferred = Q.defer() | |
if env.start_message | |
console.log env.start_message.yellow, 'Doing ', "[ #{env.command.join(' ')} ]".green | |
proc = nexpect.spawn(env.command, [], | |
stream: 'all' |
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
Generation 0 | |
Population 1 | |
--- | |
Pop Size : 100 | |
Max : 37.5 | |
Min : 14.0625 | |
Mean : 25.984375 | |
Median : 21.875 | |
Variance : 24.592529296875 |
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
# Add some useful features to array prototypes | |
Array::fold = (initial, fn) -> initial = fn initial, x for x in @; initial | |
Array::sum = -> @fold 0, (memo, i) -> memo + i | |
Array::mean = -> @sum() / @length | |
Array::max = -> Math.max.apply {}, @ | |
Array::min = -> Math.min.apply {}, @ | |
Array::median = -> if @length % 2 is 0 then (@[@length/2-1]+@[@length/2])/2 else @[Math.ceil @length/2] | |
Array::variance = -> avg = @mean(); @fold(0, (memo, i) -> memo + Math.pow i-avg, 2) / @length | |
Array::std_dev = -> Math.sqrt @variance() |
NewerOlder