Skip to content

Instantly share code, notes, and snippets.

View collinprice's full-sized avatar

Collin Price collinprice

View GitHub Profile
@NachoMan
NachoMan / DataManager.h
Created April 15, 2011 21:15
Core Data singleton manager class capable of being run from a static library
// DataManager.h
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
extern NSString * const DataManagerDidSaveNotification;
extern NSString * const DataManagerDidSaveFailedNotification;
@interface DataManager : NSObject {
}
@mwaterfall
mwaterfall / gist:953656
Created May 3, 2011 16:23
Useful Objective-C Preprocessor Macros
#define ApplicationDelegate ((MyAppDelegate *)[[UIApplication sharedApplication] delegate])
#define UserDefaults [NSUserDefaults standardUserDefaults]
#define SharedApplication [UIApplication sharedApplication]
#define Bundle [NSBundle mainBundle]
#define MainScreen [UIScreen mainScreen]
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x
#define NavBar self.navigationController.navigationBar
#define TabBar self.tabBarController.tabBar
@dideler
dideler / bootstrapping.md
Last active May 8, 2024 14:38
Bootstrapping - a list of useful resources to get up and running quickly

Welcome!

UPDATE: This list is no longer maintained. I've moved it to its own repo so you can send suggestions as Pull Requests. https://github.com/dideler/bootstrapping/

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.

@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 23, 2024 15:50
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@danmatthews
danmatthews / gist:3240064
Created August 2, 2012 19:49
Solution to doing some processing for every method of FuelPHP REST controller.
<?php
class ExampleRestController extends Controller_Rest {
/**
* Make sure the router method has the same method signature as the parent::router declaration.
* @see fuel/core/classes/controller/rest.php
*/
public function router($method, array $params) {
@aaronksaunders
aaronksaunders / acs_model_spec.js
Created February 8, 2013 23:16
sample test spec for testing async calls in alloy application using behave.js
//Setup module to run Behave tests
require('behave').andSetup(this);
describe('The model helper package: login USER', function() {
var ACSModels = new (require('models').MODELS)(Alloy);
it.eventually('*** logs in user', function(done) {
var model = ACSModels.createModel('user', {
@Jalalhejazi
Jalalhejazi / IIS_Verbs.config
Created May 26, 2013 16:58
CORS: Web.config to enable CORS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
<add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS"/>
<add name="Access-Control-Allow-Headers" value="Content-Type"/>
</customHeaders>
</httpProtocol>
@tonylukasavage
tonylukasavage / app.tss
Created July 16, 2013 14:49
TSS reset for Alloy/Titanium
'Label[platform=android]': {
color: '#000' // all platforms except Android default to black
}
'Window': {
backgroundColor: '#fff' // white background instead of default transparent
}
'Window[platform=android]': {
modal: false // make android windows all heavyweight
@larrybotha
larrybotha / A.markdown
Last active February 7, 2024 15:20
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

@jasonkneen
jasonkneen / index.js
Created May 15, 2014 14:45
Demonstrate CollapsableView Tag in Alloy.
function collapse(){
$.myView.collapse();
// $.myView.expand();
}