Skip to content

Instantly share code, notes, and snippets.

@bhutley
bhutley / osx_cal_add_event.py
Last active November 8, 2023 17:45
Python script to add a Calendar Event on OS/X using pyobjc
#!/usr/local/bin/python
# A quick script to add an event to my iCloud Home Calendar
# Usage: osx_cal_add_event.py <YYYY-MM-DD> <"Title of event">
# it adds an all-day event.
#
# By Brett Hutley <brett@hutley.net>
#
import sys
import objc
objc.setVerbose(True)
@bhutley
bhutley / keybase.md
Created March 21, 2015 09:42
keybase.md

Keybase proof

I hereby claim:

  • I am bhutley on github.
  • I am hitechnomad (https://keybase.io/hitechnomad) on keybase.
  • I have a public key whose fingerprint is 0859 CE9B D8EC 5376 34FC 9B17 9483 E96A 1D26 00A4

To claim this, I am signing this object:

import os, os.path, sys, urllib2, requests
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
@bhutley
bhutley / dropbox_client.py
Created December 2, 2012 14:02
Initialising a python script to access Dropbox
#!/usr/bin/python
#
# This is a simple script for setting up the dropbox api.
# It can be used as the basis for a more complex script.
# The file ~/.dropbox.cfg is where you store the oauth authorisation
# tokens. It has the following format:
#
#
# [AppName]
#