Skip to content

Instantly share code, notes, and snippets.

View stuppie's full-sized avatar
💭
get the bag

Gregory Stupp stuppie

💭
get the bag
View GitHub Profile
@stuppie
stuppie / bot.py
Created April 25, 2018 09:04
example bot adding an award recieved
import argparse
import json
import os
import sys
import traceback
import urllib.request
from collections import defaultdict, Counter
from datetime import datetime
from itertools import chain
from time import gmtime, strftime, sleep
@stuppie
stuppie / output
Created May 4, 2017 22:21
Benchmarking Wikidata sparql query results
$ /usr/bin/time -v python3 requests_text.py 1
Command being timed: "python3 requests_text.py 1"
User time (seconds): 0.15
System time (seconds): 0.02
Percent of CPU this job got: 11%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.60
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
@stuppie
stuppie / compare.sh
Created May 3, 2017 00:33
Comparing resources for json.loads vs requests json
#!/usr/bin/env bash
/usr/bin/time -v python3 json_loads.py
/usr/bin/time -v python3 requests_json.py
@stuppie
stuppie / check_database.py
Created April 22, 2017 21:28
Check NAR databases
from multiprocessing.pool import ThreadPool
from bs4 import BeautifulSoup
from urllib.request import urlopen
import requests
soup = BeautifulSoup(urlopen("http://www.oxfordjournals.org/nar/database/a"), "lxml")
urls = [link['href'] for link in soup.find_all('a', href=True) if link.text.strip() == "database"]
total = len(urls)
failed = 0
@stuppie
stuppie / Genes that have more than one protein.ipynb
Last active August 25, 2016 23:44
Genes that have more than one protein
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.