Skip to content

Instantly share code, notes, and snippets.

View mehlah's full-sized avatar
🎯

Mehdi Lahmam mehlah

🎯
  • Grinta
  • Saint-Etienne, France
  • X @mehlah
View GitHub Profile
<?php
namespace app\extensions\action;
/**
* Observer for the Observer pattern. When a subject sends a notification for an event,
* the registered listeners can act upon it.
*
* @author hdonner
*
@mehlah
mehlah / cron.php
Created May 10, 2012 01:35 — forked from tmaiaroto/cron.php
Lithium Cron Wrapper
<?php
/**
* This script is meant to be executed via crontab.
* It should help you easily set li3 commands as cron jobs.
*
* You should put this in the root of your application.
* However, you don't need to, but you would then need to
* pass a --path= option with the path to your app.
* This is because the li3 console command must be called
* from a specific location.
@mehlah
mehlah / bootstrap_chef_server.sh
Created April 14, 2012 00:26 — forked from woods/bootstrap_chef_server.sh
Set up rackspace cloud server as chef server
#!/bin/bash
set -e # Exit on error
set -x # Print each command
apt-get install -y lsb-release
# Set up the OpsCode repository
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
@mehlah
mehlah / ArticleControllerTest.php
Created December 18, 2011 11:48 — forked from icambridge/ArticleControllerTest.php
Controller testing lithium
<?php
namespace app\tests\cases\controllers;
use app\tests\mocks\MockArticlesController;
use app\tests\mocks\action\MockControllerRequest as Request; //Mocking the Request
class ArticlesControllerTest extends \lithium\test\Unit {
protected $_controller;
@mehlah
mehlah / index.html
Created September 5, 2011 12:28 — forked from jdonaldson/index.html
taken from block #1191530
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>bar</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="jquery.tipsy.js"></script>
<link rel="stylesheet" href="tipsy.css" type="text/css"/>
@mehlah
mehlah / MetaObject.php
Created August 31, 2011 17:19 — forked from CHH/MetaObject.php
PHP does Meta Programming too! (Requires PHP 5.4)
<?php
namespace CHH;
trait MetaObject
{
protected static $metaClass;
static function setMetaClass(MetaClass $metaClass)
{