Skip to content

Instantly share code, notes, and snippets.

/**
* NuHeat Signature Thermostat
*
* Copyright 2016 [email protected]
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@loghound
loghound / designer.html
Last active August 29, 2015 14:17
designer
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../chart-js/chart-js.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@loghound
loghound / gist:7079238
Created October 21, 2013 05:53
useful debugging macros
#ifdef DEBUG
#define DLog2(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
#define DLog(...) do { } while (0)
#ifndef NS_BLOCK_ASSERTIONS
#define NS_BLOCK_ASSERTIONS
#endif
#define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
@loghound
loghound / gist:5970802
Last active December 19, 2015 14:39
Showing an alternate way to support OO in go (original reference http://www.goinggo.net/2013/07/object-oriented-programming-in-go.html)
package main
import (
"fmt"
)
type Animal struct {
Name string
mean bool
}
@loghound
loghound / buildhelpindex.sh
Created October 30, 2010 06:56
Automate the building of help index via apples help indexer
# shell script goes here
# Create a new target called 'generate help index' that is a script target
# and contains this text -- It will run the Help Indexer (Snow Leopard style)
# and index the help in your project dir/help (replace the last argument as
# appropriate)
# John McLaughlin/Loghound.com
open -a /Developer/Applications/Utilities/Help\ Indexer.app ${PROJECT_DIR}/help
@loghound
loghound / LHSitemapVersionClass.h
Created October 25, 2010 04:46
script to auto create version info
//
// LHSitemapVersionClass.h
// SiteMap
//
// Created by John McLaughlin on 6/24/10.
// Copyright 2010 Loghound.com. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@loghound
loghound / LHErrorRecovery.h
Created September 30, 2010 00:26
Error Recovery
//
// LHErrorRecovery.h
// FlickrPlusIphotoCoreData
//
// Created by John McLaughlin on 9/29/10.
// Copyright 2010 Loghound.com. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@loghound
loghound / DLog
Created August 27, 2010 07:05
DLog
// Place this in precompile header and in place of NSLog use DLog
// When building in anything other than Debug nothing is logged
// This also provides more logging (so, the NSLog arguments, the method name and the line in code it was called on
// I can't remember where I found this online, but I claim no copyright on this :)
// ALog should be used to log things, regardless of the Build phase
#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
A test gist
No really another one