Skip to content

Instantly share code, notes, and snippets.

🐍

Terrance Terrance

🐍
Block or report user

Report or block Terrance

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 Terrance on github.
  • I am terrance (https://keybase.io/terrance) on keybase.
  • I have a public key whose fingerprint is A78E 9C1E 9514 4560 7BF0 77C8 645A 86C9 6168 F957

To claim this, I am signing this object:

@Terrance
Terrance / monzo-oauth.html
Last active Jun 26, 2018
Alternative single-HTML-file Monzo login page, a drop-in replacement for https://auth.monzo.com.
View monzo-oauth.html
<!DOCTYPE html>
<html>
<head>
<title>Monzo account access</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"
integrity="sha256-zIG416V1ynj3Wgju/scU80KAEWOsO5rRLfVyRDuOv7Q="
crossorigin="anonymous">
<style>
@Terrance
Terrance / SlackRTM.py
Last active Jun 20, 2018
A minimal asyncio client for the Slack real-time messaging (RTM) APIs.
View SlackRTM.py
import aiohttp
import asyncio
import logging
class SlackAPIError(Exception): pass
class Slack(object):
"""
@Terrance
Terrance / Hangoutsbot@.service
Created Nov 9, 2016
A systemd unit for running multiple Hangoutsbot instances.
View Hangoutsbot@.service
[Unit]
Description=Hangoutsbot: %i
After=network.target
[Service]
Type=simple
User=hangoutsbot
Group=hangoutsbot
ExecStart=/opt/hangoutsbot/venv/bin/python /opt/hangoutsbot/hangupsbot/hangupsbot.py \
--log /var/hangoutsbot/%i/hangupsbot.log \
@Terrance
Terrance / WebJoinHangouts.py
Last active Oct 30, 2016
Proof-of-concept web-based joining of Hangouts conversations, using Flask and hangups. Warning: in its current state, allows any user to be invited to any conversation available to the hangups user.
View WebJoinHangouts.py
import asyncio
import os
import shlex
from threading import Thread
import time
from emoji import emojize
from flask import Flask, redirect, render_template, request, session, url_for
import hangups
from hangups import hangouts_pb2
@Terrance
Terrance / DataUsage.py
Last active May 19, 2017
Methods for parsing free mobile data usage on Three UK and FreedomPop UK. No guarantees that these will work with paid data plans.
View DataUsage.py
from collections import namedtuple
from datetime import datetime, date, timedelta
import re
import requests
from bs4 import BeautifulSoup
Row = namedtuple("Row", ["number", "network", "total", "left", "reset"])
@Terrance
Terrance / CygwinSetup.py
Created Jun 8, 2016
A wrapper script for Cygwin's setup.exe, with argparse-based command line handling.
View CygwinSetup.py
#!/usr/bin/env python
from argparse import ArgumentParser
from itertools import chain
import os
import subprocess
try:
import urllib.request as urllib
except ImportError:
import urllib
@Terrance
Terrance / AjaxQueue.js
Created Apr 10, 2016
Limit concurrent jQuery ajax requests to at most 3 at a time, and queue the rest.
View AjaxQueue.js
var ajaxReqs = 0;
var ajaxQueue = [];
var ajaxActive = 0;
var ajaxMaxConc = 3;
function addAjax(obj) {
ajaxReqs++;
var oldSuccess = obj.success;
var oldError = obj.error;
var callback = function() {
ajaxReqs--;
@Terrance
Terrance / SMModMgr.lua
Last active Feb 26, 2016
A Lua library that simplifies scripting custom mods within a song. SM allows stepped songs (in addition to themes) to make use of additional logic programmed in Lua -- the API provides full access to notes, mods and timing.
View SMModMgr.lua
function val2key(vals)
keys = {}
for i, key in ipairs(vals) do keys[key] = true end
return keys
end
local modmgr = {}
modmgr.__index = modmgr
setmetatable(modmgr, {
@Terrance
Terrance / IngressAlertParser.md
Created Feb 12, 2016
A script for processing data from Ingress attack notification emails.
View IngressAlertParser.md

Requirements

  • phpQuery
  • Medoo

NB: db.php is just a wrapper for Medoo that reads $dbPath and returns a corresponding Medoo instance.

Database schema

You can’t perform that action at this time.