Skip to content

Instantly share code, notes, and snippets.

View salathe's full-sized avatar
🐮
🔥

Peter Cowburn salathe

🐮
🔥
  • Akamai Technologies
  • Edinburgh, Scotland
View GitHub Profile
root@4a7e05606bd1:/# cat foo.php
<?php
class MySocketServer { function run() {} }
(new MySocketServer)->run();
root@4a7e05606bd1:/# php foo.php
root@4a7e05606bd1:/# echo $?
0
salathe@php3:~# echo '<?php $str="example"; var_dump($str[1]); ?>' | ./php
X-Powered-By: PHP/3.0.18
Content-type: text/html
string(1) "x"
salathe@php3:~# echo '<?php $str="example"; var_dump($str[1]); ?>' | ./php
X-Powered-By: PHP/3.0.18
Content-type: text/html
string(1) "x"
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@salathe
salathe / locales.php
Created August 25, 2014 14:39
PHP Intl Locales
<?php
foreach (IntlCalendar::getAvailableLocales() as $locale) {
echo $locale . ' => ' . Locale::getDisplayName($locale) . PHP_EOL;
}
[peter@Bibracte php-src.git (pull-request/865 *)]$ cat foo.php
<?php
$array = new ArrayIterator(array('a', array('b', 'c')));
$regex = new RegexIterator($array, '/banana/');
foreach ($regex as $match) {
var_dump($match);
}
[peter@Bibracte php-src.git (pull-request/865 *)]$ ./sapi/cli/php foo.php
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="/static/js/analytics.js"></script>
<script type="text/javascript">archive_analytics.values.server_name="wwwb-app14.us.archive.org";archive_analytics.values.server_ms=158;</script>
<link type="text/css" rel="stylesheet" href="/static/css/banner-styles.css"/>
pcowburn@ides ~/sources/crap/melody$ cat kittens.php
<?php
<<<CONFIG
packages:
- "calebeoliveira/kittens: dev-master"
CONFIG;
echo Kitten::get() . "\n";
pcowburn@ides ~/sources/crap/melody$ docker run --rm -t -v "$PWD:/tmp/melody" -w /tmp/melody davedevelopment/melody --no-cache kittens.php -vvv
@salathe
salathe / gist:cd8b2ef3a0f91a75f7b3
Created June 3, 2015 11:31
PHP Doc build output
[peter@Bibracte phpdocs]$ svn co https://svn.php.net/repository/phpdoc/en/trunk en
A en/make_chm_index.html
A en/reference
... lots of lines ...
A en/README
U en
Checked out revision 336869.
[peter@Bibracte phpdocs]$ svn co https://svn.php.net/repository/phpdoc/doc-base/trunk doc-base
A doc-base/phpbook
<?php defined('SYSPATH') OR die('No direct access allowed.');
class form extends form_Core {
public static function open($action = NULL, $attr = array(), $hidden = NULL)
{
$form = parent::open($action, $attr);
empty($hidden) or $form .= '<div class="superfluous_markup_to_conform_to_standards">'.rtrim(form::hidden($hidden)).'</div>';