Skip to content

Instantly share code, notes, and snippets.

View matthewtole's full-sized avatar

Matthew Tole matthewtole

View GitHub Profile
@matthewtole
matthewtole / make.sh
Created August 20, 2013 21:39
Pebble build script that uses libpebble to upload the build to the watch.
PEBBLE_ID=00:18:2F:CB:F6:D7;
LIBPEBBLE_PATH=/Users/matthewtole/pebble-dev/libpebble/p.py;
clear;
./waf clean build;
if [ $? == 0 ]
then
BUILD_FILE=$(ls build/*.pbw);
$LIBPEBBLE_PATH --pebble_id=$PEBBLE_ID --lightblue reinstall $BUILD_FILE;
fi
@matthewtole
matthewtole / http-uuid.c
Last active December 20, 2015 14:09
How to simply define your UUID for Pebble apps that use httpebble in a way that makes it easy to switch between Android and iOS versions.
// To make multi-version compilation simple, these type of config defines
// should be put in an external file, such as config.h
#define ANDROID false
// If this app is being compiled for Android, use a unique UUID that uses the
// httpebble prefix, otherwise you'll have to use the common UUID
// that is defined in http.h
#if ANDROID
#define MY_UUID { 0x91, 0x41, 0xB6, 0x28, 0xBC, 0x89, 0x49, 0x8E, 0xB1, 0x47, 0xD8, 0x14, 0xF0, 0x16, 0x02, 0x14 }
#else
@matthewtole
matthewtole / httpebble-simple.c
Last active December 19, 2015 18:59
An incredibly basic Pebble app that uses httpebble.
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#include "http.h"
/* If compiling this for iOS, set ANDROID to be false. */
#define ANDROID true
#if ANDROID
#define MY_UUID { 0x91, 0x41, 0xB6, 0x28, 0xBC, 0x89, 0x49, 0x8E, 0xB1, 0x47, 0x10, 0x34, 0xBF, 0xBE, 0x12, 0x98 }
@matthewtole
matthewtole / simple-countdown.c
Last active December 19, 2015 10:49
Basic countdown app for the Pebble smartwatch.
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0xD6, 0xEB, 0x90, 0xCA, 0x3F, 0x77, 0x43, 0xB7, 0xAD, 0x5A, 0x79, 0xDE, 0x29, 0xF8, 0x68, 0x7C }
PBL_APP_INFO(MY_UUID, "Simple Countdown", "Matthew Tole", 1, 0, DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP);
Window window;
TextLayer text_layer;
var
// Node modules
mongoose = require('mongoose')
, async = require('async')
, should = require('should')
, User = require(__dirname + '/../models/user')
/**
* Mocha Test
@matthewtole
matthewtole / gecko.js
Created September 23, 2012 21:21
Gecko, a collection of utility functions for building Chameleon Launcher widgets.
//
// This Gist has now been converted into it's own GitHub repository, to be found at https://github.com/matthewtole/chameleon-gecko
//
var gecko = (function () {
var me = {};
// Launch a browser with the specified URL.
me.openUrl = function(url) {
@matthewtole
matthewtole / ShakespeareanInsult.js
Created August 31, 2012 08:57
Shakespearean Insult Generator
// Shakespearean Insult Generator
//
// Generates a random Shakespearean insult given three word lists, taken
// from this web page: http://bit.ly/OBqi3K
var ShakespeareanInsult = function() {
var words1 = [ 'artless', 'bawdy', 'beslubbering', 'bootless', 'churlish',
'cockered', 'clouted', 'craven', 'currish', 'dankish', 'dissembling',
'droning', 'errant', 'fawning', 'fobbing', 'froward', 'frothy',
@matthewtole
matthewtole / wscript
Last active August 29, 2015 13:56
wscript build configuration for Hearts.
import json
import os
from sh import karma
from sh import uglifyjs
from sh import jshint
top = '.'
out = 'build'
def options(ctx):