Skip to content

Instantly share code, notes, and snippets.

View BigAB's full-sized avatar
🇨🇦
JavaScript Loving Canadian

Adam L Barrett BigAB

🇨🇦
JavaScript Loving Canadian
View GitHub Profile
@BigAB
BigAB / ABProgressBar.h
Created December 12, 2013 22:46
A nice little customizable view for a progress bar, with optional animation properties
//
// ABProgressBar.h
// Adam L Barrett
//
// Created by Adam L Barrett on 2013-12-10.
// Copyright (c) 2013 Adam L Barrett. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@BigAB
BigAB / ABSearch.m
Created August 21, 2013 15:52
An Equality test thing that though I am deleting I think I should keep around incase something similar comes up in the future.
@implementation ABSearch
{}
- (BOOL)isEqualToSearch:(GBSearch *)search {
if (self == search)
return YES;
static NSString *objTypeIndicator = @"T@";
static NSString *timePropertyName = @"time";
static NSString *locationPropertyName = @"location";
@BigAB
BigAB / ABNullStructs.h
Created August 8, 2013 16:36
A convenience thing, just some null types for common structs and a way to check for them. Idea from this SO: http://stackoverflow.com/questions/11987142/sending-nil-to-cgpoint-type-parameter
const CGPoint ABCGPointNull = {(CGFloat)NAN, (CGFloat)NAN};
const UIOffset ABUIOffsetNull = {(CGFloat)NAN, (CGFloat)NAN};
const CGSize ABCGSizeNull = {(CGFloat)NAN, (CGFloat)NAN};
BOOL ABCGPointIsNull( CGPoint point ){
return isnan(point.x) && isnan(point.y);
}
BOOL ABUIOffsetIsNull( UIOffset offset ){
return isnan(offset.horizontal) && isnan(offset.vertical);
}
@BigAB
BigAB / ABCustomCollections.h
Created June 12, 2013 19:37
A way to create custom Collections of certain objects, that have array like qualities and are easily observed for changes. Inspired by Josh Wright/BendyTree's iOS library https://github.com/bendytree/iOS.
//
// ABCustomCollections.h
//
// Created by BigAB 1/6/2013
// Inspired by Josh Wright/BendyTree's iOS library
// https://github.com/bendytree/iOS
//
#define CUSTOMCOLLECTION_INTERFACE(classname) \
@BigAB
BigAB / README.md
Last active December 16, 2015 21:09
A category for UIView that takes the tedium out of manipulating frames (and bounds)

A category for UIView that takes the tedium out of manipulating frames (and bounds)

Plucked from this project http://nfarina.com/post/29883229869/callout-view

Use it like now you can just go

myView$.height = 44.0f;
myView.$y = (myView.$y - myView.$height);

or whatever.

@BigAB
BigAB / dabblet.css
Created December 5, 2012 04:54
16:9 Asect ratio responsive
/**
* 16:9 Asect ratio responsive
* I want the "view screen" to have a somewhat standard
* aspect ration regardless of device/window size
*/
:root, html, body {
font-size: 16px;
padding: 0;
margin: 0;
border: 0;
@BigAB
BigAB / dabblet.css
Created November 27, 2012 22:25
Touch screen inline column scroll
/**
* Touch screen inline column scroll
*/
.container {
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
font-size: 63.5%;
word-spacing: -0.43em;
letter-spacing: -0.31em;
@BigAB
BigAB / dabblet.css
Created November 22, 2012 23:37
Centered but up a bit
/**
* Centered but up a bit
* For like pages that are just sentences and such
*/
html, body {
position: relative;
height: 100%;
margin: 0;
padding: 0;
border: 0 none;
@BigAB
BigAB / dabblet.css
Created November 22, 2012 23:04
Body With Padding
/**
* Body With Padding
* Can't do body with padding (to solve earlier problem)
* has to be a inner wrapper div. Change '.demo' to
* 'body' to see what I mean.
*/
html, body {
position: relative;
height: 100%;
margin: 0;
@BigAB
BigAB / dabblet.css
Created August 20, 2012 17:56
New syntax of Flexible box layout module (flexbox)
/**
* New syntax of Flexible box layout module (flexbox)
* Send in the bugs
*/
.flexbox {
display: flex; /* Further values: -webkit-inline-flex, then it's an inline element */
flex-direction: row; /* Alignment (in this case from left to right). Further values: column (top to bottom), row-reverse (right to left), column-reverse (bottom to top) */
/* -webkit-flex-flow: row; */ /* Same as -webkit-flex-direction, but it's a shorthand for both -webkit-flex-direction und -webkit-flex-wrap (see .flexbox6) */
height: 100px;
background: lightgrey;