Skip to content

Instantly share code, notes, and snippets.

Nick Jensen nrj

Block or report user

Report or block nrj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am nrj on github.
  • I am nrj (https://keybase.io/nrj) on keybase.
  • I have a public key whose fingerprint is 6A7F 1504 2711 128C C82E AAE9 99B2 C419 439F 62B9

To claim this, I am signing this object:

@nrj
nrj / gist:7568073
Created Nov 20, 2013
Force uppercase input in UITextField.
View gist:7568073
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSString *newString = [[textField text] stringByReplacingCharactersInRange:range withString:string];
[textField setText:[newString uppercaseString]];
return NO;
}
View gist:7534043
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect {
NSMutableArray *attributesToReturn = [NSMutableArray array];
NSInteger totalItems = [[self collectionView] numberOfItemsInSection:0];
for (NSInteger i = (totalItems - 1); i >= 0; i--) {
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0];
CGRect itemRect = [[self layoutAttributesForItemAtIndexPath:indexPath] frame];
if (CGRectIntersectsRect(itemRect, rect)) {
View gist:2409425
(lldb) bt
* thread #5: tid = 0x2203, 0x3390c518 WebCore`WebCore::RenderArena::free(unsigned long, void*), stop reason = EXC_BAD_ACCESS (code=1, address=0x1ac)
frame #0: 0x3390c518 WebCore`WebCore::RenderArena::free(unsigned long, void*)
frame #1: 0x339f914a WebCore`WebCore::RenderWidget::deref(WebCore::RenderArena*) + 26
(lldb)
View gist:2408899
(lldb) bt
* thread #5: tid = 0x2203, 0x33a43cbc WebCore`WebCore::FrameLoader::cancelledError(WebCore::ResourceRequest const&) const + 4, stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
frame #0: 0x33a43cbc WebCore`WebCore::FrameLoader::cancelledError(WebCore::ResourceRequest const&) const + 4
frame #1: 0x3396d334 WebCore`WebCore::ResourceLoader::init(WebCore::ResourceRequest const&) + 172
frame #2: 0x3396d1dc WebCore`WebCore::SubresourceLoader::startLoading() + 20
frame #3: 0x3396cfc4 WebCore`WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadScheduler::HostInformation*, WebCore::ResourceLoadPriority) + 52
frame #4: 0x33972980 WebCore`WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadPriority) + 300
frame #5: 0x338cfd22 WebCore`WebCore::ThreadTimers::sharedTimerFiredInternal() + 98
frame #6: 0x338cfc94 WebCore`_ZN7WebCoreL10timerFiredEP16__CFRunLoopTimerPv + 64
frame #7: 0x3589fa32 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_
View gist:1340724
- (void)insertCell:(UIView *)cell atIndex:(NSInteger)index animated:(BOOL)animated {
CGFloat duration = animated ? kHorizontalTableViewAnimationDuration : 0;
CGRect contentRect = [contentView frame];
CGFloat colWidth = [dataSource horizontalTableView:self widthForCellAtIndex:index];
CGFloat colHeight = [dataSource respondsToSelector:@selector(horizontalTableViewCellHeight:)] ?
[dataSource horizontalTableViewCellHeight:self] : contentRect.size.height;
View gist:1238581
//
// NECacheObject.h
//
// Created by nrj on 4/28/11.
//
#import <Foundation/Foundation.h>
@interface NECacheObject : NSObject <NSCoding> {
View gist:1238573
//
// NECacheObject.m
//
// Created by nrj on 4/28/11.
//
#import "NECacheObject.h"
@implementation NECacheObject
View gist:517638
NSArray *neighbors = [currentNode getWalkableNeighbors:[currentMap tiles]];
int newG = [AStarUtil distanceTraveled:currentNode] + 1;
for (id <AStarNode>neighbor in neighbors) {
if (neighbor == [ghost currentTile]) continue;
if ([closedList containsObject:neighbor] && newG < [neighbor g]) {
View gist:448768
//
// BitmapImage.h
// GhostGuy
//
// Copyright 2010 Nick Jensen <http://goto11.net>
//
#import <Foundation/Foundation.h>
typedef unsigned char byte;
You can’t perform that action at this time.