Skip to content

Instantly share code, notes, and snippets.

View Palleas's full-sized avatar

Romain Pouclet Palleas

View GitHub Profile
<?php
class Car
{
protected $oilLevel;
protected function checkOilLevel()
{
echo "oil level checked : ";
echo $this->oilLevel;
echo "\n";
<?php
/**
*
*/
class noeWidgetFormTextarea extends sfWidgetFormTextarea
{
const CUSTOM_ATTRIBUTES_KEY = 'fieldAttributes';
public function render($name, $value = null, $attributes = array(), $errors = array())
{
@Palleas
Palleas / gist:274990
Created January 12, 2010 08:03
Testing the file HTML 5 API
<!DOCTYPE html>
<html lang="en">
<head>
<title>File API simple test</title>
<meta charset="utf-8" />
</head>
<body>
<h1>Having fun w/ HTML 5 File API</h1>
$(document).ready(function() {
$('<div id="question1"></div>').appendTo('#charBox').gchart({
series: [$.gchart.series([20, 50, 100])],
width: 200,
height: 200,
title: "What do you think about this website?",
});
})
<?php
use_javascript('/noeCommonsPlugin/js/jquery/jquery-1.3.2.min.js');
use_javascript('/noeCommonsPlugin/js/jquery/jquery.gchart.min.js');
use_javascript(url_for('noe_poll_service_stats', array(
'id' => $poll->getId(),
'target' => 'gchart',
'format' => 'js' )));
?>
<h2>Stats</h2>
<?php
/**
* render_nested_set
*
* This function is a helper used to render a nested set tree
* @param Doctrine_Collection $coll (nodes contained in current branch)
* @param array $path (path to reach the selected node)
* @return void
* @author Romain Pouclet
*/
require "open-uri"
require "rubygems"
require "nokogiri"
url = 'http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=palleas&api_key=99a9fb12391886a19391d92709401988&period=7days'
doc = Nokogiri::XML(open(url))
doc.xpath('//topartists/artist/name').each do |artist|
name = artist.content
<?php
/**
* NOELoadSQLDumpTask
*
* @package NOECommons
* @author Romain Pouclet <[email protected]>
**/
class NOELoadSQLDumpTask extends sfBaseTask
{
/**
<?xml version="1.0" encoding="utf-8"?>
<picturefinder:Facade xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
xmlns:picturefinder="com.noeinteractive.picturefinder.*"
xmlns:view="com.noeinteractive.picturefinder.view.*">
<fx:Declarations>
<picturefinder:PictureFinderContext contextView="{this}" />
</fx:Declarations>
page_show:
 url: /:slug
class: sfDoctrineRoute
options:
type: object
model: NOEpage
 param:
   module: noeBathiePageFront
   action: show