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
leads_by_email_hash.each_with_index do |hash, index| | |
by_name = leads_by_name_hash[index] | |
if closes_by_email_hash.include?(hash) | |
out += "#{hash[:community]},#{by_name[:name]},#{hash[:email]},#{sources[index]},X\n" | |
elsif closes_by_name_hash.include?(by_name) | |
out += "#{hash[:community]},#{by_name[:name]},#{hash[:email]},#{sources[index]},X\n" | |
end | |
end | |
puts out |
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/ruby | |
require 'rubygems' | |
leads = File.read('archstone_leads.csv').lines.collect {|x| x.strip} | |
closed = File.read('archstone_closed.csv').lines.collect {|x| x.strip} | |
leads_by_name_hash = [] | |
leads_by_email_hash = [] |
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 history(num=100) | |
h = Readline::HISTORY.to_a | |
start = [0,h.size-num-1].max | |
h.zip((0..h.size).to_a)[start...h.size].each do |e,i| | |
puts " #{(i).to_s.rjust(4)} #{e}" | |
end;nil | |
end | |
def hg(term) | |
num=500 | |
h = Readline::HISTORY.to_a |
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
mysql> select count(*) from residents; | |
+----------+ | |
| count(*) | | |
+----------+ | |
| 601087 | | |
+----------+ | |
1 row in set (0.21 sec) | |
mysql> select count(*) from users; | |
+----------+ |
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
mysql> select count(*) from communities; | |
+----------+ | |
| count(*) | | |
+----------+ | |
| 2451 | | |
+----------+ | |
1 row in set (0.00 sec) | |
mysql> explain SELECT `communities`.* FROM `communities` | |
INNER JOIN `residents` on `residents`.`community_id` = communities.id |
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 | |
# Checks the files to be committed for the presence of binding.pry | |
# The array below can be extended for further checks | |
checks[1]="binding.pry" | |
element_count=${#checks[@]} | |
let "element_count = $element_count + 1" | |
ROOT_DIR="$(pwd)/" |
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
### Keybase proof | |
I hereby claim: | |
* I am klochner on github. | |
* I am klochner (https://keybase.io/klochner) on keybase. | |
* I have a public key whose fingerprint is 1934 D31D 2857 BBA4 699C D5EF 5239 6745 C3F7 E0D0 | |
To claim this, I am signing this object: |
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
### Keybase proof | |
I hereby claim: | |
* I am klochner on github. | |
* I am klochner (https://keybase.io/klochner) on keybase. | |
* I have a public key whose fingerprint is BB95 4724 3DDE 55BA 16B3 0923 B9B8 24B2 9462 C374 | |
To claim this, I am signing this object: |
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
function merge(ray1, ray2) { | |
var out = []; | |
var index1 = 0; | |
var index2 = 0; | |
var length1 = ray1.length; | |
var length2 = ray2.length; | |
while (index1 < length1 && index2 < length2) { | |
var item1 = ray1[index1]; | |
var item2 = ray2[index2]; | |
if (item1 <= item2) { |
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
const merge = (a1, a2) => { | |
const a22 = a2.slice(); | |
return a1.reduce((out, e) => { | |
const index = a22.findIndex((i) => {return i > e}); | |
return out.concat(a22.splice(0,index)).concat([e]); | |
}, []).concat(a22); | |
} |