Skip to content

Instantly share code, notes, and snippets.

View Petah's full-sized avatar

David Neilsen Petah

  • Hamilton, New Zealand
View GitHub Profile
<?php
/**
* XMod\Debug\Render\HTML\Hex
*
* @author David Neilsen <david@panmedia.co.nz>
*/
namespace XMod\Debug\Render\HTML;
use XMod\Debug\Render\HTML;
class Hex {
@Petah
Petah / example.php
Last active August 29, 2015 13:57
Raptor behind authorisation
<?php require_once 'path/to/bootstrap.php'; ?>
<html>
<body>
<div class="editable" data-id="body">
<?= get_content('body'); ?>
</div>
<?php if (user_can_edit()): ?>
<script src="raptor.js"></script>
<script>
$('.editable').raptor({
<?php
class MySQLiAsyncQuery {
public $mysqli;
public $query;
public $links;
public $errors;
public $reject;
public $mysqlnd;
public $result;
<?php
use PHPExcel;
use PHPExcel_Cell as Cell;
use PHPExcel_IOFactory as IOFactory;
use PHPExcel_Style_Alignment as Alignment;
use XMod\DataTable;
class XLS {
public $datatable;
@Petah
Petah / linux
Created June 13, 2014 05:12
Composer package differences
installed:
bnet/bnmoney 1.3.3 PHP Library for dealing with money and currency
dflydev/markdown v1.0.3 PHP Markdown & Extra
ezyang/htmlpurifier dev-master 80ebd43 Standards compliant HTML filter written in PHP
facebook/php-sdk v3.2.3 Facebook PHP SDK
fzaninotto/faker dev-master 0b903ea Faker is a PHP library that generates fake data for you.
guzzle/common v3.9.1 Common libraries used by Guzzle
guzzle/http v3.9.1 HTTP libraries used by Guzzle
guzzle/parser v3.9.1 Interchangeable parsers used by Guzzle
guzzle/stream v3.9.1 Guzzle stream wrapper component
Composer version ac497feabaa0d247c441178b7b4aaa4c61b07399 2014-06-10 14:13:12
installed:
bnet/bnmoney 1.3.3 PHP Library for dealing with money and currency
dflydev/markdown v1.0.3 PHP Markdown & Extra
ezyang/htmlpurifier dev-master 80ebd43 Standards compliant HTML filter written in PHP
facebook/php-sdk v3.2.3 Facebook PHP SDK
fzaninotto/faker dev-master 0b903ea Faker is a PHP library that generates fake data for you.
guzzle/common v3.9.1 Common libraries used by Guzzle
guzzle/http v3.9.1 HTTP libraries used by Guzzle
@Petah
Petah / _references.d.ts
Created August 19, 2015 08:09
TypeScript interface, function, variable
/// <reference path="some-name.ts" />
/// <reference path="master.ts" />
@Petah
Petah / _references.d.ts
Created August 19, 2015 08:41
TypeScript namespaces and require
/// <reference path="src/someName.d.ts" />
/// <reference path="src/c1.ts" />
/// <reference path="src/c2.ts" />
/// <reference path="src/app.ts" />
@Petah
Petah / Args.php
Created February 10, 2012 04:44
PHP CSV Class
<?php
/**
* XMod\Common\Args
*
* @file
* @author David Neilsen <david@panmedia.co.nz>
*/
namespace XMod\Common;
use IteratorAggregate;
use RecursiveIteratorIterator;
@Petah
Petah / CSV.php
Created February 10, 2012 04:42
PHP CSV class
<?php
/**
* XMod\Common\CSV
* @link http://www.csvreader.com/csv_format.php
* @todo Might need option to replace characters like " with '
* @todo Needs option to escape non printable characters
* Escape codes: \### and \o### Octal, \x## Hex, \d### Decimal, and \u#### Unicode
* @author David Neilsen <david@panmedia.co.nz>
*/
namespace XMod\Format;