Skip to content

Instantly share code, notes, and snippets.

View nheagy's full-sized avatar
📌
Pinning

Nate Heagy nheagy

📌
Pinning
View GitHub Profile
@nheagy
nheagy / foo.diff
Created October 12, 2016 15:21 — forked from frosty/foo.diff
diff --git a/WordPress/Classes/Utility/WPFeedbackGenerators.swift b/WordPress/Classes/Utility/WPFeedbackGenerators.swift
index 04a9ac9..228c9d2 100644
--- a/WordPress/Classes/Utility/WPFeedbackGenerators.swift
+++ b/WordPress/Classes/Utility/WPFeedbackGenerators.swift
@@ -28,7 +28,11 @@ class WPNotificationFeedbackGenerator: NSObject {
return
}
- let generator = UINotificationFeedbackGenerator()
+ notificationOccurred(notificationType, withGenerator: UINotificationFeedbackGenerator())
const GLchar *blurVertex =
"attribute vec4 a_position;\n\
attribute vec4 a_texCoord;\n\
attribute vec4 a_color;\n\
\n\
uniform float texelWidthOffset;\n\
uniform float texelHeightOffset;\n\
\n\
varying vec2 blurCoordinates[15];\n\
varying lowp vec4 v_fragmentColor;\n\
@nheagy
nheagy / NHEdgeToEdgeScrollView.m
Created March 27, 2014 18:53
Edge-to-edge horizontal paging for CCScrollView.
@implementation NHEdgeToEdgeScrollView
- (BOOL)hitTestWithWorldPos:(CGPoint)pos
{
pos = [self convertToNodeSpace:pos];
if ((pos.y < 0) || (pos.y > self.contentSizeInPoints.height))
{
return(NO);
}
//
// HTTPRouter.h
// DynamicServer
//
// Created by Zachry Thayer on 5/9/12.
// Copyright (c) 2012 Zachry Thayer. All rights reserved.
//
#import "HTTPConnection.h"
#import "HTTPMessage.h"
@nheagy
nheagy / gist:1048093
Created June 26, 2011 23:23
Analyzer thinks I'm leaking args, which obviously I am
-(void) asyncSearchFor:(NSString *)searchTerm toCount:(int)maxCount
{
if (searchTerm == nil)
{
searchTerm = @"";
}
NSArray *args = [[NSArray alloc] initWithObjects:searchTerm, [NSNumber numberWithBool:NO], [NSNumber numberWithInt:maxCount], nil];
[self performSelectorInBackground:@selector(searchForPrep:) withObject:args];
}
@nheagy
nheagy / empty_gh-unit_test_case.m
Created April 13, 2011 19:36
Create a new file of type empty, name it MyClassTest.m where "MyClass" is the name of the class to test, and then replace all MyClass -> YourClass
//#import <GHUnitIOS/GHUnit.h> // i have this in my prefix file. Otherwise, uncomment
//#import "OCMock.h" // optional, but used often
#import "MyClass.h"
@interface MyClassTest : GHTestCase {}
@property (nonatomic, retain) MyClass *testInstance;
@end
@implementation MyClassTest
@synthesize testInstance;