Skip to content

Instantly share code, notes, and snippets.

View myles's full-sized avatar
🦖

Myles Braithwaite myles

🦖
View GitHub Profile

Keybase proof

I hereby claim:

  • I am myles on github.
  • I am myles (https://keybase.io/myles) on keybase.
  • I have a public key whose fingerprint is 45A5 ED20 B8E8 06FD 8CF8 ED1E 6A4C E837 5A2F E7BF

To claim this, I am signing this object:

@myles
myles / pushbullet.py
Last active August 29, 2015 13:57
A Python Library for Pushbullet: https://www.pushbullet.com
#!/usr/bin/env python
"""
A Python Library for Pushbullet: <https://www.pushbullet.com>.
Copyright (c) 2014, Myles Braithwaite <me@mylesbraithwaite.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@myles
myles / thumbnail_tags.py
Created March 28, 2014 21:25
A Django template tag for thumbnailing a block of HTML `img` tag using sorl-thumbnail and BeautifulSoup 4.
from bs4 import BeautifulSoup
from django import template
from sorl.thumbnail.shortcuts import get_thumbnail
from sorl.thumbnail.conf import settings as sorl_settings
register = template.Library()
@register.filter(is_safe=True)
@myles
myles / gtalug-mailing-list-stats.markdown
Last active August 29, 2015 13:58
GTALUG Mailing List Statistics
2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004
January 342 215 284 241 488 588 552 677 964 730 898
February 179 219 288 371 310 459 498 642 681 560 705
March 118 246 287 310 356 407 396 529 735 670 886
Apirl 0 348 154 254 288 514 355 505 697 901 900
May 0 384 167 332 560 324 354 513 685 1,033 615
June 0 113 345 388 444 502 369 391 588 680 594
July 0 190 234 142 258 718 354 637 535 585 636
August 0 293 322 292 375 526 474 550 688 868 584
@myles
myles / list_troll.py
Last active August 29, 2015 14:01 — forked from eleddy/list_troll.py
#! /bin/python
import urllib2
import csv
import datetime
import math
class GmaneListStats(object):
def __init__(self, what_is_recent=30, group='gmane.comp.web.zope.plone.devel'):
import sys
import json
import urllib
import clipboard
import webbrowser
data = urllib.urlopen('http://ifconfig.me/all.json')
ifconfig = json.loads(data.read())
ip_addr = ifconfig.get('ip_addr', '127.0.0.1')
Verifying that +myles is my Bitcoin username. You can send me #bitcoin here: https://onename.io/myles
@myles
myles / typogrify.rb
Created April 10, 2015 21:44
Improves typography on your Jekyll site using typogruby.
require 'typogruby'
module Jekyll
module TypogrifyFilter
# converts a & surrounded by optional whitespace or a non-breaking space
# to the HTML entity and surrounds it in a span with a styled class.
#
# @param [String] text input text
# @return [String] input text with ampersands wrapped
def amp(text)
server {
listen 80;
server_name domain.tld;
rewrite ^(.+)$ https://$server_name$1 redirect;
}
server {
listen 443;
include /etc/nginx/ssl.conf;
server_name domain.tld;
#!/bin/bash
#
# Script to update Linode's DNS Manager for a given name.
#
# Things you need to change.
APIKEY=$(cat ~/.linode-apikey)
LASTIP="/tmp/lastip"
DOMAIN="domain.com"
SOAEMAIL="hostmaster@domain.com"