Skip to content

Instantly share code, notes, and snippets.

@gordoncww
gordoncww / build_stat_dictionary.py
Last active May 30, 2019 21:00
build dictionary of swgoh.api mod stat ids and names
import requests
def build_name(stat):
if(stat['display_value'].__contains__('%')):
return stat['name'] + ' %'
else:
return stat['name']
stat_dict = {}
r = requests.get('https://swgoh.gg/api/players/995623235/mods/')
$ traceroute google.com
traceroute to google.com (172.217.1.78), 64 hops max, 52 byte packets
1 10.15.0.2 (10.15.0.2) 1.817 ms 2.014 ms 4.223 ms
2 10.15.192.4 (10.15.192.4) 1.424 ms 1.709 ms 1.375 ms
3 209.36.4.1 (209.36.4.1) 1.625 ms 1.482 ms 1.809 ms
4 12.252.143.13 (12.252.143.13) 29.072 ms 27.601 ms 29.566 ms
5 cr2.sffca.ip.att.net (12.122.114.90) 30.426 ms 37.436 ms 16.791 ms
6 12.122.137.233 (12.122.137.233) 21.953 ms 48.691 ms 58.254 ms
7 206.121.188.66 (206.121.188.66) 46.573 ms 22.371 ms 26.533 ms
8 216.239.42.157 (216.239.42.157) 48.971 ms
$ traceroute odf.import.tool.infostradasports.com
traceroute to odf.import.tool.infostradasports.com (194.105.150.218), 64 hops max, 52 byte packets
1 10.15.0.2 (10.15.0.2) 3.378 ms 4.245 ms 5.319 ms
2 10.15.192.4 (10.15.192.4) 3.263 ms 2.714 ms 3.230 ms
3 209.36.4.1 (209.36.4.1) 5.534 ms 2.578 ms 6.360 ms
4 12.252.143.13 (12.252.143.13) 5.965 ms 10.920 ms 8.447 ms
5 cr1.sffca.ip.att.net (12.122.110.58) 17.809 ms 13.697 ms 17.835 ms
6 gar23.sffca.ip.att.net (12.122.114.5) 10.741 ms 17.488 ms 10.892 ms
7 192.205.32.222 (192.205.32.222) 31.492 ms 12.087 ms 10.639 ms
8 ash-bb4-link.telia.net (213.155.135.158) 103.362 ms *
@gordoncww
gordoncww / rvm2rbenv.txt
Last active December 20, 2015 13:09 — forked from brentertz/rvm2rbenv.txt
Drop vendor/bundle and change .profile to .bashrc
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
[gordon@spider04 ~]$ sudo monit status
[sudo] password for gordon:
The Monit daemon 5.1.1 uptime: 5m
Process 'crawl-runner.rb'
status Does not exist
monitoring status monitored
data collected Sat Feb 23 01:33:27 2013
Process 'drive_itunes'
{
"cds": false,
"cto": {
"account": "disneyvideo2",
"brandSegment": "video",
"buCode": null,
"buId": null,
"categoryCode": "dcom",
"property": "Gravity Falls",
"propertyId": "4ba34a62596d559e961b9666",
let(:url) { "http://www.nbc.com/classic-tv/buck-rogers/video/episodes/#vid=213422" }
let(:important_attrs) { { :url => url ,
:image_url => "http://video.nbc.com/nbcrewind2/thumb/64_10FEFC78_51D3D_C11B6_97000_3BA864ADF_large.jpg",
:title => "Planet Of The Slave Girls, Part One",
:description => "Part 1 of 2. Buck investigates when Earth's defense squadron becomes incapacitated after ingesting poisoned food.",
:full_episode => true,
:host_name => "NBC",
:unique_id => "213422" } }
let!(:original) { FactoryGirl.create(:episode, attrs) }
<episode>
<rootId>1076792</rootId>
<tmsId>EP000013450002</tmsId>
<title>The Hammer</title>
<airDate>1967-03-02</airDate>
<seasonNumber>9</seasonNumber>
<episodeNumber>7</episodeNumber>
<description>After an apartment house manager is bludgeoned to death, Friday and Gannon track the murderer to a small Arizona town.</description>
<videos>
<video>
@gordoncww
gordoncww / gist:4165963
Created November 29, 2012 00:56
git prompt in bash rc
function gitpwd() {
if (git rev-parse HEAD &>/dev/null); then
REL=$(git rev-parse --show-prefix)
REL="${REL%/}"
LOC="${PWD%/$REL}"
echo "${LOC/*\/}${REL:+/$REL}"
elif [[ "$PWD" == "$HOME" ]]; then
echo "~"
elif [[ "${PWD:0:${#HOME}}" == "$HOME" ]]; then
echo "~${PWD:${#HOME}}"
1) MTVScraper given a clip url should create a new video
Failure/Error: subject.get_video(:url => video_url)
NoMethodError:
undefined method `index' for nil:NilClass
# ./lib/crawlers/mtv/json_parser.rb:54:in `removed'
# ./lib/crawlers/metadata_combination.rb:15:in `block in method_missing'
# ./lib/crawlers/metadata_combination.rb:13:in `each'
# ./lib/crawlers/metadata_combination.rb:13:in `method_missing'
# ./lib/video_saving.rb:7:in `public_send'
# ./lib/video_saving.rb:7:in `block in fill_video'