Skip to content

Instantly share code, notes, and snippets.

View fugufish's full-sized avatar

Jarod Reid fugufish

View GitHub Profile
require 'rspec'
def flatten(array)
ret = []
array.each do |i|
if i.is_a?(Array)
ret += flatten(i)
next
end
ret << i
end
@fugufish
fugufish / permutations.js
Created September 22, 2017 18:44
permutations
function swap(array, left, right) {
let c1 = array[left];
let c2 = array[right];
array[left] = c2;
array[right] = c1;
return array
}
function permute(string, index=0) {
// we have finished permuting the string, return the string so it can be added to the list
<?php
/*
* Hello World server
* Binds REP socket to tcp://*:5555
* Expects "Hello" from client, replies with "World"
* @author Ian Barber <ian(dot)barber(at)gmail(dot)com>
*/
$context = new ZMQContext(1);
affinity: rvm-exec 1.9.2@affinity env RACK_ENV=vanity_test BUNDLE_GEMFILE=./spec/services/affinity/Gemfile bundle exec thin start -c ./spec/services/affinity/ -p 5000
activity: rvm-exec 1.9.2@activity env RACK_ENV=vanity_test BUNDLE_GEMFILE=./spec/services/activity/Gemfile bundle exec thin start -c ./spec/services/activity/ -p 4000
humanity: rvm-exec 1.9.2@humanity env RACK_ENV=vanity_test BUNDLE_GEMFILE=./spec/services/humanity/Gemfile bundle exec thin start -c ./spec/services/humanity/ -p 4100
publicity: rvm-exec 1.9.2@publicity env RACK_ENV=vanity_test BUNDLE_GEMFILE=./spec/services/publicity/Gemfile bundle exec thin start -c ./spec/services/publicity/ -p 4200
sanity: rvm-exec 1.9.2@sanity env RACK_ENV=vanity_test BUNDLE_GEMFILE=./spec/services/sanity/Gemfile bundle exec thin start -c ../sanity/ -p 4500
tenacity: rvm-exec 1.9.2@tenacity env RACK_ENV=vanity_test BUNDLE_GEMFILE=./spec/services/tenacity/Gemfile bundle exec thin start -c ./spec/services/tenacity/ -p 4300
visibility: rvm-exec 1.9.