Skip to content

Instantly share code, notes, and snippets.

View Narven's full-sized avatar
👾
Walking to the fridge...

Pedro Luz Narven

👾
Walking to the fridge...
View GitHub Profile
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@Narven
Narven / gist:0e3c355f5ae675c2a352
Created May 13, 2014 11:59
Unity 3D C# script for continuous rotation
using UnityEngine;
using System.Collections;
// Continous rotation with some parameters
public class Rotation : MonoBehaviour
{
public enum RotationAxis
{
All,
@Narven
Narven / gist:2b37ad3b657d14798906
Created May 28, 2014 09:11
Composer Configurarion for Symfony 2
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
<?php
$qs = Doctrine_Query::create()
->from('MyTable1 m')
->leftJoin('m.MyTable2 p');
$res = $qs->execute();
$qs->free();
<?php
$str = '13++56-461.79/27--14-abc';
$filter = filter_var($str,FILTER_SANITIZE_NUMBER_INT);
$onlyDigitsFilterVar = str_replace(array('+', '-'), '', $filter);
$onlyDigitsRegexp1 = preg_replace('/[^\d]/', '', $str);
$onlyDigitsRegexp2 = preg_replace('/[^[:digit:]]/', '', $str); // http://www.php.net/manual/en/regexp.reference.character-classes.php
var_dump($filter); // string(19) "13++56-4617927--14-"
<?php
$q = Doctrine_Query::create()
->select('a.title as title')
->from('Article a')
->where('a.id = ?', $this->getId());
->fetchOne()->title;
$ curl -u user:pass -d status='Hello from shell' http://twitter.com/statuses/update.xml
/* By default, required field labels are rendered with the "required" class */
.required:after {
content: "*";
}
<?php
$lista = array_map('unserialize', array_unique(array_map('serialize', $listaAtual)));
NLS_LANG <lang> - character set, language and territory
TNS_ADMIN <path> - path to tnsnames.ora file
PATH <path> - add location of the Oracle client