Skip to content

Instantly share code, notes, and snippets.

View WyriHaximus's full-sized avatar
🐉
Breathing Fire

Cees-Jan Kiewiet WyriHaximus

🐉
Breathing Fire
View GitHub Profile
<?php
use React\Filesystem\Node\NodeInterface;
require dirname(__DIR__) . '/vendor/autoload.php';
$loop = \React\EventLoop\Factory::create();
$i = 0;
$dir = \React\Filesystem\Filesystem::create($loop)->dir(__DIR__);
{
"require": {
"react/event-loop": "^0.4.1",
"react/promise": "^2.2"
}
}
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Message\Response;
use React\EventLoop\Factory;
use React\Filesystem\Filesystem;
use React\Filesystem\Stream\WritableStreamInterface;
use WyriHaximus\React\RingPHP\HttpClientAdapter;
var c=0;setInterval(function(){if (c==16777216)c=0;document.getElementsByName('theme-color')[0].setAttribute('content', '#'+ ('00000' + c.toString(16)).slice(-6));c++;},1);
{% extends "default" %}
{% block metaTags %}
<meta name="robots" content="index, follow">
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@WyriHaximus" />
<meta name="twitter:title" content="{{ page.title }}" />
<meta name="twitter:description" content="{{ page.blocks.content|split('<!-- More -->', 2)[0]|raw|striptags }}" />
<meta name="twitter:url" content="{{ site.url }}{{ page.url }}" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@WyriHaximus" />
<meta name="twitter:title" content="{{ page.title }}" />
<meta name="twitter:description" content="{{ page.blocks.content|split('<!-- More -->', 2)[0]|raw|striptags }}" />
<meta name="twitter:url" content="{{ site.url }}{{ page.url }}" />
@WyriHaximus
WyriHaximus / sculpin_kernel.yml
Created January 30, 2015 18:29
sculpin_kernel.yml
services:
twig.extension.text:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }
return futurePromise($loop)->then(function () use ($loop, $check) {
$result = $check();
if ($result !== false) {
return $result;
}
return tickingFuturePromise($loop, $check);
});
/*$deferred = new Deferred();
$loop->futureTick(function () use ($deferred, $check, $loop) {
<?php
(function() {
$app = new \Slim\Slim();
$app->get('/hello/:name', function ($name) {
echo "Hello, $name";
});
$app->run();
})();
<?php
$loader = include __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$counter = 0;
$timer = $loop->addPeriodicTimer(10, function($timer) use($loop, &$counter) {
$counter++;
$type = 'None';