Skip to content

Instantly share code, notes, and snippets.

Phillip Gruneich philgruneich

Block or report user

Report or block philgruneich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am philgruneich on github.
  • I am philgruneich (https://keybase.io/philgruneich) on keybase.
  • I have a public key ASCImpS5AkiYRlekKl0e5xDWhf7uKDFxUjYlcA7aBcsOEQo

To claim this, I am signing this object:

@philgruneich
philgruneich / check_training_demand.js
Created May 1, 2018
CSM: calculate how much training will require to reach limits before 28yo on transfer list
View check_training_demand.js
Array.from(document.querySelectorAll('article.player')).forEach((player) => {
const age = +player.querySelector('.general .first-col li:nth-child(2)').textContent.substr(5, 2);
const rx = /(\d+)[^\d]*(\d+)?/;
const skills = player.querySelector('.skills-bar');
const aim = skills.querySelector('li:first-child .visual').textContent.trim().match(rx);
const handling = skills.querySelector('li:nth-child(3) .visual').textContent.trim().match(rx);
const quickness = skills.querySelector('li:nth-child(5) .visual').textContent.trim().match(rx);
const determination = skills.querySelector('li:nth-child(6) .visual').textContent.trim().match(rx);
const awareness = skills.querySelector('li:nth-child(7) .visual').textContent.trim().match(rx);
let player_skills = {
@philgruneich
philgruneich / gist:77d5f3c6c76717cd62e59de7ba6e9137
Created May 1, 2018
Automatically trains pickup players GLB2
View gist:77d5f3c6c76717cd62e59de7ba6e9137
var request = new XMLHttpRequest();
var counter = 0;
var limit = 40; // Trains 40 times
var counterFunction = function() {
request.abort();
request.open('POST', '/game/player/' + glb2.player.playerId + '/pickup_join', true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
if (!!+request.responseText) ++counter;
if (counter >= limit) window.clearInterval(interval)
View Complete Reminder.py
# coding: utf-8
import reminders
import sys
import dialogs
import webbrowser
from urllib import quote
def completeReminder():
View MovieDiaryConfig.py
# coding: utf-8
import dialogs
import keychain
import console
import cPickle
from urllib import quote, unquote
class NoConfigError (Exception): pass
class MissingConfigError (Exception): pass
View FixMovieDiary.py
# coding: utf-8
import keychain
import console
from urllib import quote, unquote
keychain.set_password('MovieDB', 'API', console.input_alert('Insert your MovieDB API key', '', keychain.get_password('MovieDB', 'API')))
keychain.set_password('Airtable', 'API', console.input_alert('Insert your Airtable API key', '', keychain.get_password('Airtable', 'API')))
keychain.set_password('Airtable', 'Movie Diary', console.input_alert('Insert your Airtable database ID', '', keychain.get_password('Airtable', 'Movie Diary')))
keychain.set_password('Airtable', 'Movie Diary Table', quote(console.input_alert('Insert the name of your Airtable table', '', unquote(keychain.get_password('Airtable', 'Movie Diary Table')))))
View Movie Diary.py
#!/usr/bin/env/python2
# coding: utf-8
import requests
import json
import appex
import dialogs
import re
import datetime
import keychain
@philgruneich
philgruneich / New from Gist.py
Created Jan 30, 2016
Adds Python gists to Pythonista.
View New from Gist.py
# coding: utf-8
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.
#
# If a file already exists, a dialog is shown that asks whether the
# new file should be renamed or replaced.
@philgruneich
philgruneich / OCRtoInteract.py
Last active Mar 21, 2019
Requires Pythonista for iOS and Interact for iOS. Sends image and returns OCR'd text. Opens text in Interact unless used from action extension, then adds to clipboard.
View OCRtoInteract.py
# coding: utf-8
import requests
import photos
from PIL import Image, ImageEnhance
import StringIO
import appex
import console
import json
import keychain
@philgruneich
philgruneich / tumblr.js
Created May 13, 2015
Open in Tumblr App
View tumblr.js
javascript:(function() {var tumblr=document.querySelector("meta[name='twitter:app:url:iphone']").getAttribute('content');if (tumblr.match(/^tumblr:\/\/x-callback-url\/blog\?.*/)) window.location=tumblr;})();
You can’t perform that action at this time.