Skip to content

Instantly share code, notes, and snippets.

View klochner's full-sized avatar

kevin lochner klochner

View GitHub Profile

Keybase proof

I hereby claim:

  • I am klochner on github.
  • I am klochner (https://keybase.io/klochner) on keybase.
  • I have a public key ASC-KjZ6uBhZC8Vq49IRxWTU0i1LZATvBksX83nkhbPB7Qo

To claim this, I am signing this object:

@klochner
klochner / gist:89cf497e9ca5ad84488fad41ab934466
Last active September 15, 2016 22:12
PML web request & response
req:
{"sLNm":"89DFEEB7-B67C-4D1C-8B63-A68200E942F0","sAllAppsHasCreditReportOnFile":"0","sLPurposeT":"1","IsProduction":"True","UseBpmiSingle":"False","UseBpmiSplit":"False","IsEnabledLockPeriodDropDown":"True","AvailableLockPeriodOptionsCSV":"15,30,45,60,75,90,,,","sProdRLckdDays":"60","sProdRLckdExpiredDLabel":"11/14/2016 (Assumes a 60-day lock.)","sSpAddr":"","sSpZip":"94597","sSpStatePe":"CA","sSpCounty":"Contra Costa","sSpCity":"Walnut Creek","sProdIsSpInRuralArea":"False","sOccTPe":"0","sSpGrossRentPe":"$0.00","sOccRPe":"100.000%","sHasNonOccupantCoborrowerPe":"False","sProdSpT":"0","sProdSpStructureT":"2","sProdIsNonwarrantableProj":"False","sProdIsCondotel":"False","sFhaCondoApprovalStatusT":"0","sProdCondoStories":"1","sIsRenovationLoan":"False","sTotalRenovationCosts":"$0.00","sLPurposeTPe":"1","sProdIsLoanEndorsedBeforeJune09":"False","sProdCashoutAmt":"$0.00","sProdCurrPIPmt":"$0.00","sProdCurrPIPmtLckd":"False","sProdCurrMIPMo":"$0.00","sIsCreditQualifying":"False","sHasAppraisal":"False","sSpLie
{"sLNm":"68012F41-2047-4B4E-B93E-A68101449392","sAllAppsHasCreditReportOnFile":"0","sLPurposeT":"1","IsProduction":"True","UseBpmiSingle":"False","UseBpmiSplit":"False","IsEnabledLockPeriodDropDown":"True","AvailableLockPeriodOptionsCSV":"15,30,45,60,75,90,,,","sProdRLckdDays":"60","sProdRLckdExpiredDLabel":"11/10/2016 (Assumes a 60-day lock.)","sSpAddr":"","sSpZip":"94597","sSpStatePe":"CA","sSpCounty":"Contra Costa","sSpCity":"Walnut Creek","sProdIsSpInRuralArea":"False","sOccTPe":"0","sSpGrossRentPe":"$0.00","sOccRPe":"100.000%","sHasNonOccupantCoborrowerPe":"False","sProdSpT":"0","sProdSpStructureT":"2","sProdIsNonwarrantableProj":"False","sProdIsCondotel":"False","sFhaCondoApprovalStatusT":"0","sProdCondoStories":"1","sIsRenovationLoan":"False","sTotalRenovationCosts":"$0.00","sLPurposeTPe":"1","sProdIsLoanEndorsedBeforeJune09":"False","sProdCashoutAmt":"$0.00","sProdCurrPIPmt":"$0.00","sProdCurrPIPmtLckd":"False","sProdCurrMIPMo":"$0.00","sIsCreditQualifying":"False","sHasAppraisal":"False","sSpLien":"$
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);
}
#!/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)/"
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
mysql> select count(*) from residents;
+----------+
| count(*) |
+----------+
| 601087 |
+----------+
1 row in set (0.21 sec)
mysql> select count(*) from users;
+----------+
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
#!/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 = []
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