Skip to content

Instantly share code, notes, and snippets.

View umbrella.py
# -*- coding: utf-8 -*-
from json import loads
from requests import get
import location
from datetime import date
import time
from console import alert
# Customization here
APItoken = 'Insert your API token here'
View Bullseye.bookmarklet
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})();
@philgruneich
philgruneich / glb2login.py
Created April 12, 2014 16:41
Logs into GLB2 and grabs the HOF source code.
View glb2login.py
import requests
from bs4 import BeautifulSoup as bs
login = {
'action': 'login',
'user_name':'your username',
'password':'your password'
}
with requests.Session() as c:
@philgruneich
philgruneich / glb2_character_calculator.py
Created April 13, 2014 00:13
Character Calculator for GLB2
View glb2_character_calculator.py
# encoding: utf-8
from functools import reduce
from operator import mul
heights_help = {'56':66, '57':67, '58':68, '59':69, '510':70, '511':71, '60':72, '61':73, '62':74, '63':75, '64':76, '65':77, '66':78, '67':79, '68':80}
traits_help = {'Unpr-edic-table': 'unpredictable', 'Blocking Back': 'hb_blocking_back', 'Solid Frame': 'qb_solid_frame', 'Nerves of Steel': 'nerves_of_steel', 'Speedster': 'wr_speedster', 'Ball Hawk': 'ball_hawk', 'Blitzer': 'lb_blitzer', 'Tactician': 'tactician', 'Dominator': 'wr_control', 'Man Specialist': 'man_specialist', 'Consistent Blocker': 'ol_consistent_blocker', 'Early Bloomer': 'early_bloomer', 'Run Stuffer': 'dl_run_stuffer', 'Technical Blocker': 'ol_tech_blocker', 'Sure Tackler': 'sure_tackler', 'Precision Passer': 'qb_precision_passer', 'Fearsome': 'fearsome', 'Long Reach': 'long_reach', 'Thick Skin': 'thick_skin', 'Coverage LB': 'lb_coverage', 'Quick Feet': 'quick_feet', 'Slippery': 'slippery', 'Shifty': 'wr_shifty', 'Slot Receiver': 'wr_slot_receiver', 'Pass Rusher': 'd
@philgruneich
philgruneich / glb2calc.py
Last active August 29, 2015 13:59
Calculator module for GLB2
View glb2calc.py
# -*- coding: UTF-8 -*-
from functools import reduce
from operator import mul
class glb2calc:
def __init__(self, position, height, weight, trait1, trait2, trait3, strength=5, speed=5, agility=5, stamina=5, awareness=5, confidence=5):
if stamina + strength + confidence + awareness + agility + speed < 35:
print('You have {0} attribute points left.'.format(35 - (stamina + strength + confidence + awareness + agility + speed)))
elif stamina + strength + confidence + awareness + agility + speed > 35:
@philgruneich
philgruneich / movieDiary.py
Last active August 29, 2015 14:02
Grab IMDB data to fill a MultiMarkdown table to be sent to Day One
View movieDiary.py
#coding: utf-8
from urllib import quote
import json
import re
import sys
import webbrowser
import requests
import htmlentitydefs
movie = quote(sys.argv[1])
@philgruneich
philgruneich / cleanLinksRiposte.js
Created November 17, 2014 03:13
Sends URL to Clean Links and generates a Markdown link for Riposte
View cleanLinksRiposte.js
javascript:window.location='clean-links://x-callback-url/clean?url='+encodeURIComponent(location.href)+'&x-success='+encodeURIComponent('drafts4://x-callback-url/runAction?text='+encodeURIComponent('['+document.title+'](||clipboard||)')+'&action=Send%2520to%2520Riposte&afterSuccess=Delete')
@philgruneich
philgruneich / superstar.json
Created December 10, 2014 23:00
Superstar JSON
View superstar.json
"superstar_avg": {
"skill_modifiers": {
"punt_power": {
"cost": -0.2,
"max": 10
},
"tackle_awareness": {
"cost": -0.2,
"max": 10
},
@philgruneich
philgruneich / Toggle Invisible Files.scpt
Created March 16, 2014 05:06
Show/Hide invisible files in Finder. Add to ~/Library/Application Support/Launchbar/Scripts to launch from Launchbar.
View Toggle Invisible Files.scpt
set stateMent to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if stateMent = "TRUE" then
do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE"
end if
tell application "Finder" to quit
delay 2
launch application "Finder"
@philgruneich
philgruneich / Groceries: Drafts, Ita and Fantastical
Created June 26, 2013 00:20
From Drafts, it creates an event on Fantastical named "Ir ao Supermercado" ("Go to the Supermarket", in portuguese), starting in your current day at 7PM and ending 30 minutes later. Then it attached the draft you wrote in Drafts to a Ita list named "Compras" ("Groceries", in portuguese). Previously, we also included the url-scheme to view this l…
View Groceries: Drafts, Ita and Fantastical
fantastical://x-callback-url/parse?title=Ir%20ao%20supermercado&start=[[date]]%2019:00&end=[[date]]%2019:30&url=ita://openList%3Flist%3DCompras&x-source=Ita&x-success={{ita://addItem?list=Compras&items=[[draft]]}}