Skip to content

Instantly share code, notes, and snippets.

@jpadilla
jpadilla / gist:2275208
Created April 1, 2012 13:08
Facebook locale codes
$list = array(
"ca_ES" => "Català",
"cs_CZ" => "Čeština",
"cy_GB" => "Cymraeg",
"da_DK" => "Dansk",
"de_DE" => "Deutsch",
"eu_ES" => "Euskara",
"en_PI" => "English (Pirate)",
"en_UD" => "English (Upside Down)",
"ck_US" => "Cherokee",
static $regions = array(
'Africa' => DateTimeZone::AFRICA,
'America' => DateTimeZone::AMERICA,
'Antarctica' => DateTimeZone::ANTARCTICA,
'Asia' => DateTimeZone::ASIA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Europe' => DateTimeZone::EUROPE,
'Indian' => DateTimeZone::INDIAN,
'Pacific' => DateTimeZone::PACIFIC
);
@jpadilla
jpadilla / Profiler.php
Created April 2, 2012 12:35
Doctrine 2 Logger for CodeIgniter's Profiler
<?php
namespace Doctrine\DBAL\Logging;
class Profiler implements SQLLogger
{
public $start = null;
private $ci;
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class Forms {
public function getForm($form) {
return new $form;
}
}
class BaseForm {
public function validate() {
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class Forms {
public function getForm($form) {
return new $form;
}
}
class BaseForm {
public function validate() {
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation {
/**
* Generic callback used to call callback methods for form validation.
*
* @param string
* - the value to be validated
* @param string
Array
(
[0] => stdClass Object
(
[name] => US East
[language] => en_US
[countries_id] => 231
[regions_id] => 1
[short_name] => United States Minor Outlying Islands
)
var productList = [
{
image: 'http://placehold.it/80x40',
product_part: {
name: '932-MIKROE-430',
url: 'http://www.mouser.com/ProductDetail/mikroElektronika/MIKROE-430/?qs=jBNCx3lXxWsfMeB5a61JlJaB1xWuDJlNcFz8Mb7F45k%3d'
},
mfr_part: {
name: 'MIKROE-430',
url: 'http://www.mouser.com/ProductDetail/mikroElektronika/MIKROE-430/?qs=jBNCx3lXxWsfMeB5a61JlJaB1xWuDJlNcFz8Mb7F45k%3d'
City/Ciudad: Mountain View
Country Code/Código País: US
Country Name/País: United States
Custom/Personalizado: Mountain View , California (USA)
Array:
Array
(
[ip] => 8.8.8.8
[country_code] => US
[country_code3] => USA
Testing Gist Package