Skip to content

Instantly share code, notes, and snippets.

View objectiveSee's full-sized avatar

Danny Ricciotti objectiveSee

  • Starship Studios
View GitHub Profile
request.setTimeout 1000 () =>
console.log('TIMEOUT???!??!?!');
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kGameCellIdent forIndexPath:indexPath];
if ( cell.tag != 1 ) {
UITapGestureRecognizer tappy = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_cellTapped:)];
[cell addGestureRecognizer:tappy];
cell.tag = 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
EALobbyGameCell *cell = [tableView dequeueReusableCellWithIdentifier:kGameCellIdent forIndexPath:indexPath];
if ( [cell viewWithTag:444] == nil ) {
// make gesture recoginzer and give it a tag of 444
})
// set target here
@implementation UIDevice (EAAdditions)
+ (BOOL)isFourInch
{
static dispatch_once_t onceToken;
static BOOL itIs = NO;
dispatch_once(&onceToken, ^{
CGRect screenBounds = [[UIScreen mainScreen] bounds];
if (screenBounds.size.height == 568) {
itIs = YES;
Evil Apples is hiring!
=== HOORAY ===
Our App has over 250,000 downloads and at any given moment a TON of socket connections.
We are a Top 5 Word Game and Top 100 Game in the Apple App Store!
We are getting more and more attention every day so it is time to find a Node guru to
take charge. A wizard or Jedi is also acceptable.
No sorcerers. We don't trust sorcerers.
@objectiveSee
objectiveSee / foo.h
Last active December 23, 2015 23:39
Category that enforces objects in a dictionary are of the type I expect them to be.
/**
THE PROBLEM:
NSDictionary *d = [sever getMeta];
// d.score returns something of type 'NSArray'
NSNumber *userId = [d objectForKey:@"score"];
NSInteger i = [userId integerValue]; // <<------- Now what happens!
var cluster = require('cluster'),
redis = require("socket.io/node_modules/redis"),
numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
//master process - fork children
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
@objectiveSee
objectiveSee / gist:6605956
Created September 18, 2013 07:52
Xcode5 is saying Socket.IO uses private selectors
+ (id) objectFromJSONData:(NSData *)data error:(NSError **)error {
Class serializer;
// try SBJson first
serializer = NSClassFromString(@"SBJsonParser");
if (serializer) {
id parser;
id object;
parser = [[serializer alloc] init];
var post_options = {
host: 'https://buy.itunes.apple.com',
port: '80',
path: '/verifyReceipt',
method: 'POST',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// 'Content-Length': bodyData.length
// }
- (void)_getProductsById:(NSSet *)productIDs
{
NSAssert(self.requestingProducts, @"Should be busy from previous method (getProductsWithCompletion)");
NSAssert(self.productRequest == nil, @"logic");
EALog(@"Getting items: %@", productIDs);
SKProductsRequest *productRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIDs];
[productRequest setDelegate:self];