Skip to content

Instantly share code, notes, and snippets.

View danker's full-sized avatar

Eric Danker danker

  • Breo Media LLC
  • St. Louis
View GitHub Profile
@danker
danker / scraper.py
Last active August 6, 2023 22:13
Otherdeeds Scraper
import requests
import time
import csv
MAX_DEEDS = 1000
BASE_URL = "https://api.otherside.xyz/lands"
SLEEPY_TIME = .5
# --------------------------------------------------------------------------
import os, csv, sys, argparse
parser = argparse.ArgumentParser(
description='Filter the contact list. Produce one sub-list per title provided, filtering out non-desired titles.')
parser.add_argument('--filter', nargs='*', help="titles we're not interested in'")
parser.add_argument('titles', nargs='*', help='titles we *are* interested in')
args = parser.parse_args()
from datetime import datetime, timedelta
now = datetime.now()
print("Now: {}".format(now))
print("Today's date: {}".format(now.strftime('%m/%d/%Y')))
#print("year: {}".format(now.year))
#print("month: {}".format(now.month))
#print("day: {}".format(now.day))
#print("hour: {}".format(now.hour))
import sys
import mimetypes
import requests
import requests_aws4auth as aws4auth
import xml.etree.ElementTree as ET
import xml.dom.minidom as minidom
access_id = ''
access_key = ''
region = 'us-west-1'
@danker
danker / The Technical Interview Cheat Sheet.md
Last active August 27, 2015 02:04 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@danker
danker / lol-recent-games.groovy
Created August 2, 2015 03:59
Groovy script that will pull stats on recent games for the specified SummonerID.
import groovyx.net.http.RESTClient
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1' )
def API_KEY = "INSERT-API-KEY-HERE"
def SUMMONER_ID = "28450305"
// FULL DOCUMENTATION AT: https://developer.riotgames.com/api/methods
def client = new RESTClient('https://na.api.pvp.net')
def RECENT_GAMES_PATH = "/api/lol/na/v1.3/game/by-summoner/" + SUMMONER_ID + "/recent"
@danker
danker / conwayGoL.go
Created July 12, 2015 20:01
Conway's Game of Life in Go.
package main
import (
"fmt"
"math/rand"
"time"
"github.com/nsf/termbox-go"
)
@danker
danker / naLCSRankings.py
Created July 11, 2015 18:17
Scrape the LoL eSports site to get current NA LCS Rankings. (A simple script to test web-scraping in Python)
import requests
from bs4 import BeautifulSoup
import time
url_to_scrape = 'http://na.lolesports.com/na-lcs/2015/summer/standings'
r = requests.get(url_to_scrape)
# parse the text of the URL
soup = BeautifulSoup(r.text, "html.parser")
@danker
danker / twilio_sms.groovy
Created June 28, 2015 00:11
Groovy script to send an SMS via Twilio API
import org.apache.http.auth.AuthScope
import org.apache.http.auth.UsernamePasswordCredentials
import org.apache.http.client.CredentialsProvider
import org.apache.http.client.HttpClient
import org.apache.http.client.entity.UrlEncodedFormEntity
import org.apache.http.client.methods.CloseableHttpResponse
import org.apache.http.client.methods.HttpPost
import org.apache.http.impl.client.BasicCredentialsProvider
import org.apache.http.impl.client.HttpClientBuilder
import org.apache.http.message.BasicNameValuePair
@danker
danker / commonPrefix.groovy
Created November 23, 2010 04:23
Find common prefix given a list of words
//PROBLEM: Find the common prefix for all input words (i.e. "aa" for the list given below)
def words = ['aaaaaee', 'aaabck', 'aajj', 'aaaabbbcccc']
def letterIdx = 0
def shouldContinue = true
def commonPrefix = new StringBuffer()
while (shouldContinue) {