Skip to content

Instantly share code, notes, and snippets.

View a2's full-sized avatar
🐼

Alex Akers a2

🐼
View GitHub Profile
@jspahrsummers
jspahrsummers / gist:2f482aa03009cb7a8646
Created June 22, 2014 07:04
Capturing an `inout` parameter for later use
struct Property<T> {
let name: String
let _getter: () -> T
let _setter: T -> ()
var value: T {
get {
return _getter()
}
@indragiek
indragiek / LTClientBrowser.h
Last active August 29, 2015 14:01
ReactiveCocoa-based wrapper around NSNetServiceBrowser
//
// LTClientBrowser.h
// LayerTreeServer
//
// Created by Indragie Karunaratne on 2014-05-21.
// Copyright (c) 2014 Indragie Karunaratne. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <LayerTreeKit/LayerTreeKit.h>
@jspahrsummers
jspahrsummers / GHReadWriteQueue.h
Last active December 22, 2016 16:15
Non-blocking mutual exclusion with readers and writers, for asynchronous operations that may span more than one GCD block (making a single concurrent GCD queue unsuitable).
//
// GHReadWriteQueue.h
// GitHub
//
// Created by Justin Spahr-Summers on 2014-03-24.
// Copyright (c) 2014 GitHub. All rights reserved.
//
#import <Foundation/Foundation.h>
#include <pebble.h>
#include "scroll-text-layer.h"
#define MAX_HEIGHT 2000
#define PADDING_X 4
#define PADDING_Y 4
struct ScrollTextLayer {
TextLayer* text_layer;
ScrollLayer* scroll_layer;
/***
* Data Processor
* Copyright © 2014 Matthew Tole
***/
#include <pebble.h>
#include "data-processor.h"
static char* data_start = NULL;
static char* data_pos = NULL;
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@matthewtole
matthewtole / font-loader.c
Last active December 30, 2015 09:49
Font Loader
/***
* Font Loader
* Copyright © 2013 Matthew Tole
*
* 1.0.0
***/
#include <pebble.h>
#include "font-loader.h"
/***
* Message Queue
* Copyright © 2013 Matthew Tole
*
* Version 1.0.0
***/
#include <pebble.h>
#include "message-queue.h"
@matthewtole
matthewtole / bitmap-loader.c
Last active April 21, 2016 01:23
Bitmap Loader
/***
* Bitmap Loader
* Copyright © 2013 Matthew Tole
*
* Version 2.0.2
***/
#include <pebble.h>
#include "bitmap-loader.h"
@matthewtole
matthewtole / pebble-assist.h
Last active December 29, 2015 16:39
Pebble Assist - A collection of utility macros to make Pebble app development a bit simpler.
/***
* Pebble Assist
* Copyright (C) 2014 Matthew Tole
*
* Version 0.2.0
***/
/**
The MIT License (MIT)