Skip to content

Instantly share code, notes, and snippets.

View jb3's full-sized avatar
😁
#OpenErlang

Joe Banks jb3

😁
#OpenErlang
View GitHub Profile
@jb3
jb3 / config
Created February 25, 2018 12:55
Polybar configuration
[colors]
accent = #fba922
[bar/top]
enable-ipc = true
monitor = eDP-1
width = 100%
height = 33
;background = #222
@jb3
jb3 / keybase.md
Created September 10, 2018 15:23
keybase.md

Keybase proof

I hereby claim:

  • I am jos-b on github.
  • I am josephbanks (https://keybase.io/josephbanks) on keybase.
  • I have a public key ASAn-gKMjV9hnH6LufuWRnRcab3R7KcZCSDryMTuvX01_Ao

To claim this, I am signing this object:

#include <array>
#include <cstdio>
#include <cstring>
#include <discord_rpc.h>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <string>
#include <thread>
@jb3
jb3 / distort.py
Created January 28, 2019 20:07
Apply a liquid rescale to a set of images to construct a gif of distortion.
#!/usr/bin/env python3
# USAGE NOTES
#
# - You must create a directory called pngs
# - Once you have created your images you must run the following command to create a gif:
# convert -delay 1x8 `seq -f pngs/out-%03g.png 0 1 40` -coalesce out.gif
#
# This script depends on imagemagick, liblqr (liquid rescale) and wand for python (pip install Wand)
from pypresence import Presence
import time
client_id = "503540314506657792"
rpc = Presence(client_id)
rpc.connect()
data = {
"large_image": "smiley",
import urllib.parse
from typing import Union
import httpx
with open("./github.access") as token_file:
token = token_file.read().strip()
def get(route: str, arguments: dict = {}) -> Union[dict, list]:
return httpx.get(
@jb3
jb3 / bot.py
Created July 6, 2020 10:27
Example of patching some Discord.py objects
from discord import Client
from patches import patch_discord_py
patch_discord_py()
client = Client()
@client.event
async def on_message(msg):
@jb3
jb3 / modqueue_relay.py
Created July 14, 2020 22:57
Reddit report to Discord relay
import httpx
from praw import Reddit
from praw.models import Comment, Submission
from datetime import datetime
r = Reddit(
client_id="",
client_secret="",
password="",
user_agent="pythonmodqueuerelay by /u/Im__Joseph",
import asyncio
import aiodns
loop = asyncio.get_event_loop()
resolver = aiodns.DNSResolver(loop=loop)
async def lookup(tld, data):
try:
data[tld] = await resolver.query(tld, "A")
except:
@jb3
jb3 / phabricator.yaml
Last active August 12, 2020 20:01
Phabricator k8s deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: modcast-phabricator
spec:
revisionHistoryLimit: 2
replicas: 1
selector:
matchLabels:
app: modcast-phabricator