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
smiley@smiley-laptop:~/code/brawl-scrape$ cat go.py | |
#!/usr/bin/python | |
import nflgame | |
import ipdb | |
import time | |
CURRENT_YEAR = 2014 | |
CURRENT_WEEK = 4 | |
CURRENT_KIND = 'PRE' |
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
N.B. This all assumes that you currently connect to the VPN through a VirtualBox Ubuntu machine. If you don't, no problem, but you're gonna have to make it work with whatever your setup is! | |
IN YOUR VBox VM | |
1. sudo apt-get install openconnect | |
2. Make an executable shell script in your home directory: | |
#!/bin/bash | |
openconnect -u yourusername_us https://myaccess.oraclevpn.com/ |
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
module CompaniesHelper | |
ALL_SUFFIXES = %w(organic paid local) | |
ALL_ENGINES = %w(google yahoo bing search) | |
def hour_options_for_select | |
@hour_options ||= (0..23).map do |n| | |
suffix = n >= 12 ? 'PM' : 'AM' | |
hour = n % 12 | |
hour = 12 if hour.zero? | |
["#{hour} #{suffix}", n] |
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
File.open("/tmp/ts1.csv","w") { |f| f.write(ClassificationModels::CallNet.generate_training_csv(TrainingSet.find(1).calls)) } |
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
ids = IO.read("/tmp/ids.txt").split(","); | |
calls = Call.where(id: ids); | |
CSV.open("/tmp/export-scoring.csv", "wb") do |csv| | |
calls.each do |c| | |
c = c.decorate | |
csv << [ c.id, c.duration, c.recording_mp3.expiring_url(time=1.week).to_s, "https://app.callrail.com#{c.web_waveform_path('primary')}", "https://app.callrail.com#{c.web_waveform_path('secondary')}", c.start_time, c.network, c.company.id, c.company.name ] | |
end | |
end; |
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
{ | |
"item": 5000, | |
"min": { | |
"value": 0 | |
}, | |
"goal": { | |
"value": 100000 | |
}, | |
"max": { | |
"value": 120000 |
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
{ | |
"item": [ | |
{ | |
"value": 2000, | |
"text": "Calls Scored Today" | |
} | |
] | |
} |
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 pexpect | |
from pexpect import pxssh | |
import pdb | |
def do_lines(ssh, lines): | |
for line in lines.split("\n"): | |
line = line.strip() | |
print(line) | |
ssh.sendline(line) | |
ssh.prompt(timeout=300) |
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
Call.where(start_time: 1.month.ago..DateTime.now).each do |call| | |
unless InvoiceItem.exist?(billable: call) | |
call.sidekiq(queue: :manual).create_invoice_item | |
end | |
end |
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
ZipCode.create(zip: '12179', latitude: 42.711440, longitude: -73.525561) | |
ZipCode.create(zip: '12593', latitude: 42.243991, longitude: -73.641076) | |
ZipCode.create(zip: '01133', latitude: 42.170731, longitude: -72.604842) | |
ZipCode.create(zip: '01195', latitude: 42.1029, longitude: -72.5921) |
OlderNewer