Skip to content

Instantly share code, notes, and snippets.

View rhyspowell's full-sized avatar

Rhys Powell rhyspowell

View GitHub Profile
@rhyspowell
rhyspowell / draw_table.py
Created December 25, 2023 21:18 — forked from xiaopc/draw_table.py
Draw a table using only Pillow
from PIL import Image, ImageFont, ImageDraw
from collections import namedtuple
def position_tuple(*args):
Position = namedtuple('Position', ['top', 'right', 'bottom', 'left'])
if len(args) == 0:
return Position(0, 0, 0, 0)
elif len(args) == 1:
return Position(args[0], args[0], args[0], args[0])
import json
import os
import requests
_url = "http://intranet.mycompany.com/v7/api/1.1/"
def send_request():
username = os.environ['USERNAME']
@rhyspowell
rhyspowell / videoflashcards.py
Created December 13, 2017 10:37 — forked from anonymous/videoflashcards.py
Utility Script forr Building Video Flashcards
from moviepy.audio.io.AudioFileClip import AudioFileClip
from moviepy.editor import *
import subprrocess
def word_to_audio(word, outfile, voice="tessa"):
"""Yeah, this is gonna be mac only"""
subprocess.call(["say", word, "-o", outfile, "-v", voice])
def audio_clip(outfile):
return AudioFileClip(outfile)
@rhyspowell
rhyspowell / index.html
Last active November 16, 2017 20:51
XY frame grid | Foundation 6.4 Docs
<div class="grid-y medium-grid-frame">
<div class="cell shrink header medium-cell-block-container">
<h1>Grid Frame Header</h1>
<div class="grid-x padding-gutters">
<div class="cell medium-4">
<p> This demo shows what is possible with the new Foundation 6.4 XY Grid</p> </div>
<div class="cell medium-4 medium-cell-block">
<p style="width:80vw;">This is a horizontal cell block - on medium+ it will overflow automatically</p>
</div>
<div class="cell medium-4">
@rhyspowell
rhyspowell / keybase.md
Created May 13, 2017 20:19
keybase authentication step

Keybase proof

I hereby claim:

  • I am rhyspowell on github.
  • I am rhyspowell (https://keybase.io/rhyspowell) on keybase.
  • I have a public key ASCZuW3aBywl_IbAmZh9-WbaHnwvw9gv-OSjFhYLNwH-zwo

To claim this, I am signing this object:

@rhyspowell
rhyspowell / sqs.py
Created November 1, 2016 12:00 — forked from philchristensen/sqs.py
Minimal script for sending/reading from Amazon SQS using Boto/Python.
conf = {
"sqs-access-key": "",
"sqs-secret-key": "",
"sqs-queue-name": "",
"sqs-region": "us-east-1",
"sqs-path": "sqssend"
}
import boto.sqs
conn = boto.sqs.connect_to_region(
@rhyspowell
rhyspowell / send_pdf_with_boto_ses.py
Created October 24, 2016 15:10 — forked from yosemitebandit/send_pdf_with_boto_ses.py
send PDF attachment with boto and SES
''' quick example showing how to attach a pdf to multipart messages
and then send them from SES via boto
'''
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import boto
@rhyspowell
rhyspowell / android-convert.sh
Created May 26, 2016 20:56 — forked from informationsea/android-convert.sh
Convert SVG images to Android icons
#!/bin/zsh
for i in *.svg; do
inkscape -e ../res/drawable-hdpi/${i%.svg}.png -w 48 -h 48 $i
inkscape -e ../res/drawable-mdpi/${i%.svg}.png -w 32 -h 32 $i
inkscape -e ../res/drawable-xhdpi/${i%.svg}.png -w 64 -h 64 $i
inkscape -e ../res/drawable-xxhdpi/${i%.svg}.png -w 96 -h 96 $i
done
inkscape -e ../ic_launcher.png -w 512 -h 512 ic_launcher.svg
@rhyspowell
rhyspowell / config.py
Created May 17, 2016 20:41 — forked from bonzanini/config.py
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
Verifying that +bleachin is my openname (Bitcoin username). https://onename.com/bleachin