Skip to content

Instantly share code, notes, and snippets.

View davidino's full-sized avatar

David Funaro davidino

  • AWS
  • Dublin
  • 01:10 (UTC +01:00)
View GitHub Profile
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
if ([tabBarController.viewControllers objectAtIndex:1] == viewController)
{
UIViewController *articles = [[ListViewController alloc] initWithStyle:UITableViewStylePlain andArticles:[self.appDelegate getPreferredArticles]];
[articles setTitle:@"Preferiti"];
// Pass the selected object to the new view controller.
[viewController setTitle:@"prova"];
[viewController.navigationController pushViewController:articles animated:YES];
[articles release];
@davidino
davidino / getIdVideo.php
Created May 5, 2011 14:10
Youtube Widget & Validator for Symfony
<?php
$urls = array(
'/http:\/\/www.youtube.com\/watch\?v=([a-zA-Z0-9_-]+)([%&=#a-zA-Z0-9_-])*/',
'/http:\/\/www.youtube.com\/watch#\!v=([a-zA-Z0-9_-]+)([%&=#a-zA-Z0-9_-])*/',
'/http:\/\/youtu.be\/([a-zA-Z0-9_-]+)/',
);
$youtube_video_id = preg_replace($urls, '$1', $videoUrl);
@davidino
davidino / annotation.php
Created May 23, 2011 09:32
how to use doctrine annotations
<?php
//http://jwage.com/2010/08/02/doctrine-annotations-library/
//http://www.doctrine-project.org/projects/common/2.0/docs/reference/annotations/en
namespace Orient;
require_once 'lib/Doctrine/Common/ClassLoader.php';
use Doctrine\Common\ClassLoader;
@davidino
davidino / result.json
Created May 29, 2011 10:45
some result
{ "schema": {
"id": 16,
"name": "GraphMotocycle",
"properties":{
"inEdges":{
"id": 1,
"name": "inEdges",
"type": "LINKSET",
"mandatory": false,
"notNull": false,
tabBarController = [[UITabBarController alloc] init];
[tabBarController setDelegate:self];
//home
IndigeniWebViewController *home = [[IndigeniWebViewController alloc] initWithNibName:@"IndigeniWebViewController"
bundle:nil
withUrl:[NSString stringWithFormat:@"%@/home%@",urlIdg,coordinate]];
idcontroller = home;
@davidino
davidino / DslCarForm.class.php
Created June 1, 2011 15:20
documentation congow
<?php
public function configure()
{
parent::configure();
//visualizzare i campi internazionalizzati
$this->i18nize();
//si occupa di integrare nel form la spunta di pubblicazione
<link rel="stylesheet" id="NextGEN-css" href="http://www.tuosito.com/wp-content/plugins/nextgen-gallery/css/nggallery.css?ver=1.0.0" type="text/css" media="screen" />
<link rel="stylesheet" id="shutter-css" href="http://www.tuosito.com/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.css?ver=1.3.0" type="text/css" media="screen" />
<script type="text/javascript">
/* <![CDATA[ */ var shutterSettings = { msgLoading: "L O A D I N G", msgClose: "Click to Close", imageCount: "1" }; /* ]]> */ </script>
<script type="text/javascript" src="http://www.tuosito.com/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.js?ver=1.3.0"></script>
<script type="text/javascript" src="http://www.tuosito.com/wp-includes/js/jquery/jquery.js?ver=1.3.2"></script>
<script type="text/javascript"> /* <![CDATA[ */ var ngg_ajax = { path: "http://YourSite.com/wp-content/plugins/nextgen-gallery/", loading: "loading" }; /* ]]> */ </script>
<script type="text/javascript" src="http://www.tuosito.com/wp-content/plugins/next
php -S localhost:8124
<?php
$a = array(
'logger' => function () {echo 'loggin really serious stuff';}
);
echo $a['logger']() . "\n";
$(document).ready(function(){
$('select[name="country"]').change(changeProvince());
var changeProvince = function(){
var country = this.value;
console.log(country);
@davidino
davidino / spikeDM.php
Created September 19, 2011 21:59
lazy loading programming data mapper.
<?php
/**
*
*/
class ClassName {
public function setAuthor($fun)
{