Skip to content

Instantly share code, notes, and snippets.

<?php
include '../inc/header_admin.php';
if($_SERVER['SERVER_NAME'] == 'localhost')
{
error_reporting(-1);
ini_set('mysql.trace_mode', true);
}
$filename = '../maj_dossier/EXPARTHQ.txt';
@echo off
setlocal
cd /d %~dp0
:: initialization
if [%1] == [--reinstall] (
if exist vendor (
rd /s /q vendor
)
(function (jwplayer) {
var template = function (player, config, div) {
function setup(event) {
config.links = [];
config.last = null;
var summary = document.getElementById(config.id);
if (summary) {
var links = summary.getElementsByTagName('a');
@stealth35
stealth35 / WebSocket.php
Created June 5, 2011 17:47
PHP WebSocket
<?php
class WebSocket
{
protected $url;
protected $protocols;
protected $socket;
public function __construct($url, $protocols = array())
{
$this->url = $url;
@stealth35
stealth35 / gist:1125760
Created August 4, 2011 17:53
test atoum
php -dphar.readonly=0 atoum/scripts/phar/generator.php -d ./
php mageekguy.atoum.phar -d atoum/tests/units
> atoum version 325 by Frédéric Hardy (phar:///Users/stealth35/Documents/mageekguy.atoum.phar)
> PHP path: /usr/bin/php
> PHP version:
=> PHP 5.3.6 with Suhosin-Patch (cli) (built: Jun 16 2011 22:26:57)
=> Copyright (c) 1997-2011 The PHP Group
=> Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
=> with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
@stealth35
stealth35 / extra.js
Created October 14, 2011 19:19
Moodle course files uploader
if (window.location.pathname.search('course/view') > 0) {
window.onload = function (event) {
if (typeof FormData === 'undefined') {
return;
}
var forms = document.forms;
for (var f = 0; f < forms.length; ++f) {
if (typeof forms[f].edit !== 'undefined') {
@stealth35
stealth35 / tree.php
Created October 25, 2011 17:02
PHP Iterator refcount crash
<?php
$tree = array();
$branch = &$tree;
$courses = array(
'f1' => '/d1',
'f6' => '/d2',
'f7' => '/d3',
'f8' => '/d3/d4',
'f9' => '/d3/d4',
@stealth35
stealth35 / ZipArchiveIterator.php
Created October 27, 2011 16:23
ZipArchiveIterator
<?php
class ZipArchiveIterator implements \Iterator, \SeekableIterator, \Countable
{
private $current;
private $position;
private $zip;
public function __construct($file_name)
{
$this->zip = new \ZipArchive();
@stealth35
stealth35 / BinaryFileResponse.php
Created December 13, 2011 14:04
BinaryFileResponse with X-SendFile and Date Range
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@stealth35
stealth35 / gist:1476550
Created December 14, 2011 13:24
Zend Server get_defined_functions
Array
(
[internal] => Array
(
[0] => zend_version
[1] => func_num_args
[2] => func_get_arg
[3] => func_get_args
[4] => strlen
[5] => strcmp