Skip to content

Instantly share code, notes, and snippets.

View tunitowen's full-sized avatar

Tony Owen tunitowen

  • OwenTech Ltd
  • Leeds
View GitHub Profile
@tunitowen
tunitowen / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../paper-button/paper-button.html">
@tunitowen
tunitowen / gist:9618413
Last active August 29, 2015 13:57
NSNumber Macros
// magic macros
#define N(x) [NSNumber numberWithInt: x]
#define B(x) [NSNumber numberWithBool: x]
NSMutableArray *array = [[NSMutableArray alloc] init];
// long way
[array addObject:[NSNumber numberWithBool:YES]];
[array addObject:[NSNumber numberWithInt:1]];
@tunitowen
tunitowen / gist:9599186
Last active June 24, 2017 17:27
HTML to NSAttributedString
NSString *html = @"<div style='font: 18pt Helvetica-Light; color: #3498DB;'>Blue Text<span style='color: #AAAAAA;'>GreyText</span></div>"];
NSData *htmlData = [html dataUsingEncoding:NSUTF8StringEncoding];
NSMutableAttributedString *htmlAttributedString = [[NSMutableAttributedString alloc] initWithData:htmlData options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType} documentAttributes:nil error:nil];
[label setAttributedText:htmlAttributedString];
@tunitowen
tunitowen / adbconnect.sh
Created November 7, 2013 13:02
Shell script to enable ADB over TCPIP
#!/bin/sh
IP_ADDRESS=$(adb shell ifconfig wlan0 | awk '{print $3}')
echo $IP_ADDRESS
adb tcpip 5555
adb connect $IP_ADDRESS