Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcio Valenzuela quique123

View GitHub Profile
View Plist
{
results = (
{
createdAt = "2012-07-09T07:13:24.593Z";
details = "First Store";
image = {
"__type" = File;
name = "9d2d8a0d-36fb-4abe-9908-bebd7fb39056-christmas.gif";
url = "http://files.serverapp.com/bcee5dd3-46dc-40a8-abe6-37da2732e809/1store.png";
@quique123
quique123 / AppDelegate
Last active Dec 14, 2015
first run check
View AppDelegate
-(void)checkIfFirstRun{
NSString *bundleVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
NSString *appFirstStartOfVersionKey = [NSString stringWithFormat:@"first_start_%@", bundleVersion];
NSNumber *alreadyStartedOnVersion = [[NSUserDefaults standardUserDefaults] objectForKey:appFirstStartOfVersionKey];
if(!alreadyStartedOnVersion || [alreadyStartedOnVersion boolValue] == NO) {
// Preload plist data
[self parsePlistIntoCD];
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES] forKey:appFirstStartOfVersionKey];
}
@quique123
quique123 / AppDelegate.m
Created Feb 27, 2013
Cocos2d Image Size Bug
View AppDelegate.m
//
// AppDelegate.m
// Honduras
//
// Created by Marcio Valenzuela on 7/8/11.
// Copyright Personal 2011. All rights reserved.
//
#import "cocos2d.h"
View SecondViewController
//
// SecondViewController.m
// FarsimanTab
//
// Created by Marcio Valenzuela on 11/26/12.
// Copyright (c) 2012 Marcio Valenzuela. All rights reserved.
//
#import "SecondViewController.h"
#import "SDCoreDataController.h"
View Layer.mm
//
// Puzzle2Layer.m
// iSanti
//
// Created by Marcio Valenzuela on 1/19/12.
// Copyright 2012 M2Studio. All rights reserved.
//
#import "Puzzle2Layer.h"
#import "SimpleQueryCallback.h"
@quique123
quique123 / json.php
Created Sep 24, 2012
json php file
View json.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Converts to and from JSON format.
*
* JSON (JavaScript Object Notation) is a lightweight data-interchange
* format. It is easy for humans to read and write. It is easy for machines
* to parse and generate. It is based on a subset of the JavaScript
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
@quique123
quique123 / CPHopper.m
Created May 9, 2012
Chipmunk Hopper v6
View CPHopper.m
static cpBool preSolveHG(cpArbiter *arb, cpSpace *space, CPHopper *hopper){/////////////pass it hopper reference
if(cpvdot(cpArbiterGetNormal(arb, 0), ccp(0,-1)) < 0){/////////////////////////////ignore bottom collision
cpArbiterIgnore(arb);
return cpFalse;
}
////////////////////////////////////////////////////////////////////////If collision from top, set to TRUE
hopper.isOnGround = TRUE;
return cpTrue;
}
View CPHopper.m
@implementation CPHopper
@synthesize groundShapes, jetpack, hasShield;
@synthesize myDebugLabel;
//methods for collision detec chipmunk
static cpBool beginHG(cpArbiter *arb, cpSpace *space, void *ignore) {
CP_ARBITER_GET_SHAPES(arb, hopperShape, groundShape);
CPHopper *hopper = (CPHopper *)hopperShape->data;
cpVect n = cpArbiterGetNormal(arb, 0);
if (n.y < 0.0f) {
@quique123
quique123 / user_save.php
Created Apr 17, 2012
createUserLoginphp
View user_save.php
<?
include"master_inc.php";
//--------------------------------------------------------------------------RECEIVE LOCAL VARIABLES FROM FORM
$lastname = strip_tags(substr($_POST['lastname'],0,32));
$firstname = strip_tags(substr($_POST['firstname'],0,32));
$phone = strip_tags(substr($_POST['phone'],0,32));
$password_hint=$_REQUEST['password_hint'];
$noERROR=1;
$udidposted = $_REQUEST['udid'];
@quique123
quique123 / CPHopper.h
Created Apr 12, 2012
Chipmunk Collision Detecion
View CPHopper.h
//
// CPHopper.h
// PlanetHopper
//
// Created by Marcio Valenzuela on 12/29/11.
// Copyright (c) 2011 M2Studio. All rights reserved.
//
#import "CPSprite.h"
You can’t perform that action at this time.