This file contains 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
Traceback (most recent call last): | |
File "/tmp/runscript.py", line 207, in <module> | |
download_and_install(args.extra_py_files, timeout=time_out) | |
File "/tmp/runscript.py", line 137, in download_and_install | |
download_from_s3(s3_file_path, local_file_path) | |
File "/tmp/runscript.py", line 165, in download_from_s3 | |
retry(_download_from_s3, s3, bucket_name, s3_key, new_file_path, exceptions=TimeoutError, message="downloading {} from s3".format(s3_script_location)) | |
File "/tmp/runscript.py", line 35, in retry | |
return func(*func_args) | |
File "/tmp/runscript.py", line 164, in _download_from_s3 |
This file contains 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
# ---------------------------------------------- | |
# SHOW LISTINGS THAT HAPPENED FOR A GIVEN AGENT | |
# ---------------------------------------------- | |
# 1. given an agent, how many listings did they have since the beginning of the year? | |
# 2. for each listing, show the contact's name, address, star rating, and date the listing was first detected | |
def show_listings_proof(user_id, since_date=Time.now.beginning_of_year) | |
puts "agent_name,contact_name,address,city,state,max_star_rating_in_12_months_prior_to_listing,max_star_rating_date,date_of_listing" | |
if user_id.nil? | |
# no user_id -> show for ALL USERS |
This file contains 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
# ------------------------------------------------------------- | |
# SEND PUSHES TO ALL WHO RECEIVED A TILE AND DIDN'T DISMISS IT | |
# ------------------------------------------------------------- | |
# `days_threshold` should be just more than 1 cycle of the campaign's delivery time. example: if a campaign is sent each tuesday, and it's the following tuesday, set `days_threshold` to 8 | |
def send_pushes_to_recipients_of_campaign(campaign_id, days_threshold=8) | |
message = "📈 Rising Seller Scores 📈 Set a Next Step for 1 of these high priority contacts and you're sure to stay on top of your follow up." | |
push_name = "increasing_sscores_1wk_nudge" | |
date_name = "05_22_2019" |
This file contains 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
# 1. given a brokerage (or all users), how many listings did each agent have? | |
# 2. from those listings, how many did First "predict"? | |
# 3 star over the last 12 months = predicted | |
def show_listings_proof(brokerage_name=nil, since_date=Time.now.beginning_of_year) | |
show_listings_counts_per_agent_for_brokerage(brokerage_name, since_date) | |
end | |
def show_listings_counts_per_agent_for_brokerage(brokerage_name, since_date) | |
if brokerage_name.nil? |
This file contains 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 print_groups_with_contacts_for_user_id_and_contact_ids(user,contact_ids) | |
results = user | |
.contacts | |
.of_interest | |
.joins(:contact_groups) | |
.where('contact_groups.created_at >= ?', Time.now.beginning_of_year) | |
.pluck("people.id, contact_groups.name, contact_groups.created_at, contact_groups.id") | |
hit_count_for_user = 0 | |
results.each do |r| |
This file contains 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
SUPPORTED_ASSOCIATIONS = [:email_addresses, :names, :phone_numbers, :properties] | |
def ids_of_complete_contacts_for(user, without: []) | |
without = Array(without) | |
with = SUPPORTED_ASSOCIATIONS - without | |
# all contacts | |
q = user.contacts | |
# for associations we want to verify, add a WHERE EXISTS query for it | |
with.each do |assoc| | |
q = add_subquery(q, assoc, user, exists: true, user_sourced: false) |
This file contains 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
Verifying my identity on Peepeth.com 0x1c2c3150e1c5eac41e8aad7039ecb51b669d7331 |
This file contains 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
import Foundation | |
func sumOfDigits(_ n: Int) -> Int { | |
guard n > 0 else { return 0 } | |
let nString = String(n) | |
let nArray = Array(nString) | |
var sumOfInts = 0 | |
for item in nArray { | |
if let itemInt = Int(String(item)) as? Int { | |
sumOfInts += itemInt |
This file contains 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
Verifying that "humphriesjm.id" is my Blockstack ID. https://onename.com/humphriesjm |
This file contains 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
0x6108D91F9d90647e1Bd7A415a2AEB9A694FE8Bfe |
NewerOlder