Skip to content

Instantly share code, notes, and snippets.

View aaronbassett's full-sized avatar

Aaron Bassett aaronbassett

  • Pyth Data Association
  • 03:13 (UTC +01:00)
View GitHub Profile
while True:
for infile in glob.glob("pride/*.png"):
im = Image.open(infile)
pixel_grid = list(im.getdata())
for channel in range(8):
pixels = pixel_grid[channel:-1:8]
for num, pixel in enumerate(pixels):
pixel = darken_color(pixel[0], pixel[1], pixel[2], factor=0.3)
set_pixel(mote_hosts, channel + 1, num, pixel[0], pixel[1], pixel[2])
@aaronbassett
aaronbassett / sms.py
Created June 11, 2019 15:04
Python Glasgow
# Basic send
response = client.send_message({'from':NEXMO, 'to':ME, 'text':'Merry Christmas'})
response['messages'][0]['status']
# Send as my dad
response = client.send_message({'from':os.environ['DADS_NUMBER'], 'to':ME, 'text':'I\'m proud of you'})
response['messages'][0]['status']
# Send as Python Glasgow
response = client.send_message({'from':'PyGlasgow', 'to':ME, 'text':'Hello!'})
@aaronbassett
aaronbassett / fancy_sms.py
Created December 21, 2018 16:02
Send Fancy SMS with Python and the Nexmo SMS API
import os
import click
import nexmo
import string
@click.command()
@click.argument(
"font",
type=click.Choice(
@aaronbassett
aaronbassett / may_the_4th.json
Created June 7, 2017 17:26 — forked from judy2k/may_the_4th.json
May the 4th be with you!
[{
"action": "talk",
"voiceName": "Brian",
"text": "May the fourth be with you!"
}]

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@aaronbassett
aaronbassett / model.py
Created April 13, 2015 11:27
Basic Django model
# -*- coding: utf-8 -*-
# !important
# Native
# Django
from django.db import models
from django.conf import settings
# 3rd Party
from model_utils.models import TimeStampedModel
from autoslug import AutoSlugField

Keybase proof

I hereby claim:

  • I am aaronbassett on github.
  • I am aaronbassett (https://keybase.io/aaronbassett) on keybase.
  • I have a public key whose fingerprint is F804 D17C 6396 487D FF5D EF9C F2D0 7E56 518A E6C3

To claim this, I am signing this object:

#!/bin/bash
# This is untested but you get the basic idea
# Why? Cause fuck dependencies that's why ;)
if [[ $# -lt 1 ]]; then
echo "Usage: $0 INFILE"
exit 1
fi