Skip to content

Instantly share code, notes, and snippets.

View a2's full-sized avatar
🐼

Alex Akers a2

🐼
View GitHub Profile
/***
* Message Queue
* Copyright © 2013 Matthew Tole
*
* Version 1.0.0
***/
#include <pebble.h>
#include "message-queue.h"
@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"
/**
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.
/***
* Data Processor
* Copyright © 2014 Matthew Tole
***/
#include <pebble.h>
#include "data-processor.h"
static char* data_start = NULL;
static char* data_pos = NULL;
#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;
@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>
@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 / 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()
}
@staltz
staltz / introrx.md
Last active September 11, 2026 21:25
The introduction to Reactive Programming you've been missing
@natecook1000
natecook1000 / dumpmodule.sh
Created October 8, 2014 21:05
Dump the Swift-synthesized headers for a module
#! /bin/sh
# usage: <shellscript> [--osx] typename
if [ "$1" = "--osx" ] ; then
echo ":print_module $2" | xcrun swift -deprecated-integrated-repl
else
sdk_path=$(echo `xcrun --show-sdk-path` | sed 's#MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk#iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk#')
echo ":print_module $1" | xcrun swift -deprecated-integrated-repl -sdk "$sdk_path"
fi