Skip to content

Instantly share code, notes, and snippets.

View Katharine's full-sized avatar

Katharine Berry Katharine

View GitHub Profile
#!/usr/bin/env python
import zipfile
import os
import argparse
import logging
def copy_zip_file(filename, zip_from, zip_to):
logging.info("Copying (%s --> %s): %s ", zip_from.filename, zip_to.filename, filename)
zip_to.writestr(filename, zip_from.read(filename))
require 'curses'
class PebbleSdk < Formula
class Version < ::Version
def <=> (other)
mine = ::Version.new(self.to_s.sub('dp', 'alpha'))
other = ::Version.new(other.to_s.sub('dp', 'alpha'))
mine <=> other
end
end
In [1]: pixels = []
In [2]: colours = (0, 85, 170, 255)
In [3]: for r in colours:
...: for g in colours:
...: for b in colours:
...: pixels.append((r, g, b))
...:
import math
from array import array
class ZStatement(object):
def __init__(self, label=None, opcode=None, operands=None, store=False, branch=False):
super(ZStatement, self).__init__()
self.label = label
self.opcode = opcode
self.operands = operands
self.store = store

Keybase proof

I hereby claim:

  • I am Katharine on github.
  • I am katharine (https://keybase.io/katharine) on keybase.
  • I have a public key whose fingerprint is 7364 6C3F BC91 CCB7 432A 56E8 177A EFA4 6EDA 4EB3

To claim this, I am signing this object:

"abort",
"atexit",
"exit",
"system",
"getenv",
"labs",
"div",
"llabs",
"bsearch",
"qsort",
[Error] ReferenceError: Can't find variable: mixpanel
(anonymous function) (www.treasuredata.com, line 1)
[Error] [object Object]
error (gtm.js, line 49)
onerror (gtm.js, line 49)
replaceChild
Ca (gtm.js, line 47)
Ha (gtm.js, line 47)
Aa (gtm.js, line 46)
aa (gtm.js, line 44)
@Katharine
Katharine / hello.c
Created April 3, 2014 21:07
Hello world!
#include <pebble.h>
Window *window;
TextLayer *text_layer;
void handle_init(void) {
// Create a window and text layer
window = window_create();
text_layer = text_layer_create(GRect(0, 0, 144, 154));
@Katharine
Katharine / gist:8432720
Created January 15, 2014 08:31
Linting failure report.
Setting top to : /tmp/tmpj7gnmZ
Setting out to : /tmp/tmpj7gnmZ/build
Checking for program gcc,cc : arm-none-eabi-gcc
Checking for program ar : arm-none-eabi-ar
Found Pebble SDK in : /home/vagrant/sdk2/Pebble
'configure' finished successfully (0.030s)
Waf: Entering directory `/tmp/tmpj7gnmZ/build'
Traceback (most recent call last):
File "/home/vagrant/sdk2/Pebble/.waf-1.7.11-e248e7c2ab5100c227e21b0fb258ca96/waflib/Scripting.py", line 97, in waf_entry_point
run_commands()
@Katharine
Katharine / anim_schedule.c
Created May 30, 2013 11:24
This code will crash your watch.
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0xF7, 0x58, 0xEF, 0x93, 0x27, 0xBB, 0x4F, 0x0E, 0x93, 0x9A, 0x8F, 0x6A, 0xF1, 0x6F, 0x0A, 0x63 }
PBL_APP_INFO(MY_UUID,
"Animation Crash", "Your Company",
1, 0, /* App version */
DEFAULT_MENU_ICON,