Skip to content

Instantly share code, notes, and snippets.

<?php
class ArrayTest extends PHPUnit_Framework_TestCase {
public function testNextAndPrev1(){
$rs = array(1=>1,2=>2,3=>3,4=>4,5=>5);
$curID = 3;
$prev = null;
foreach ($rs as $ID => $r){
@cirpo
cirpo / gist:549466
Created August 25, 2010 13:11 — forked from odino/gist:549438
<?php
class Pippo{
private _$asset = null;
public function getAsset()
{
if(null === $this->asset)
<?php
class OrdinativiMenuItemDayTable extends Doctrine_Table
{
public static function getInstance()
{
return Doctrine_Core::getTable('OrdinativiMenuItemDay');
}
public class UtenteManagedBean{
public String deleteUtente() {
Utente utente = (Utente) getFacesContext().getApplication().createValueBinding("#{list}").getValue(getFacesContext());
utenteManagerLocal.removeUtente(utente);
return "success";
}
}
<?php
public function likeAction()
{
// Make sure user exists
if( !$this->_helper->requireUser()->isValid() ) return;
// Collect params
$action_id = $this->_getParam('action_id');
$viewer = $this->_helper->api()->user()->getViewer();
<?php
$url = "http://example.org";
$curlSession = curl_init();
$putParameters = array('email' => '[email protected]', 'username' => 'pluto');
curl_setopt($curlSession,CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curlSession,CURLOPT_URL, $url);
curl_setopt($curlSession, CURLOPT_CUSTOMREQUEST, 'PUT');
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
alias 'll=ls -lah'
PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
export PSI
PATH=/usr/local/bin:$PATH:/usr/local/mysql/bin/; export PATH
@cirpo
cirpo / gist:734801
Created December 9, 2010 15:10
my bashrc
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
export EDITOR=vim
export VISUAL=vim
alias 'll=ls -lah'
alias 'zf=/usr/local/Cellar/php/5.3.3/lib/php/bin/zf.sh'
var oggettoX = function(){
var valore = 0;
return {
increment : function(inc){
valore += inc;
},
getValue: function(){
return valore;
}
@cirpo
cirpo / .bashrc
Created December 25, 2010 21:56
se vuoi puoi prendere spunto...
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
export EDITOR=vim
export VISUAL=vim
alias 'll=ls -lah'
alias 'zf=/usr/local/Cellar/php/5.3.3/lib/php/bin/zf.sh'