Skip to content

Instantly share code, notes, and snippets.

View kelunik's full-sized avatar

Niklas Keller kelunik

View GitHub Profile
<?php
set_include_path(__DIR__."/../:.");
require('autoload.php');
require('functions.php');
require('Libraries/Tpl.php');
use Arya\Request;
use Arya\Response;
[
{
"methods": [
{
"name": "run",
"returnComment": "",
"params": [],
"comment": "Die run-Methode des Threads baut eine Verbindung zum Server aus.\n Sobald dieser Thread erfolgreich abgeschlossen ist, kann die Verbindung\n zur Kommunikation genutzt werden.",
"type": "void",
"modifiers": "public"
@kelunik
kelunik / remove-w3schools-from-google-search.user.js
Created December 9, 2014 13:52
Remove w3schools.com from Google Search results
// ==UserScript==
// @name Remove w3schools.com from Google
// @namespace https://www.kelunik.com
// @include https://www.google.com/*
// @include https://www.google.de/*
// @version 1
// @grant none
// ==/UserScript==
function forEach(list, callback) {
#!/bin/bash
set -e
set -x
if [ $1 == "master" ]
then
wget https://github.com/php/php-src/archive/master.zip -O master.zip
rm -rf php-src-master
unzip -q master.zip
@kelunik
kelunik / setup.sh
Last active March 10, 2016 11:32
X1C Install
#!/bin/bash
# re-run as root if necessary
if [[ $EUID -ne 0 ]]; then
sudo ./$0
exit
fi
# apt-get install -y acpi
@kelunik
kelunik / github-conversations.user.js
Last active August 29, 2015 14:27
GitHub Conversations
// ==UserScript==
// @name GitHub Conversations
// @namespace http://kelunik.com/
// @version 0.4
// @description Provides a next button to jump between conversations in large diffs on GitHub.
// @author Niklas Keller
// @match https://github.com/*/*/commit/*
// @grant none
// ==/UserScript==
@kelunik
kelunik / Dockerfile
Last active August 29, 2015 14:28
Docker PHP 7
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y wget
RUN apt-get install -y unzip
RUN apt-get install -y gcc
RUN apt-get install -y make
RUN apt-get install -y autoconf
RUN apt-get install -y bison
@kelunik
kelunik / travis-ip-ranges.txt
Created November 23, 2015 17:16
Travis IP Ranges
The IP addresses depend on what environment they run in.
For jobs running on the container-based infrastructure, the range is 54.172.141.90/32 for .com and 52.0.240.122/32 for .org.
For jobs running on the legacy Linux infrastructure, the ranges are 199.91.168.0/22, 199.182.120.0/22 and 173.247.96.0/19. These are the ranges of our infrastructure provider, so they may also include hosts that do not belong to Travis CI.
For jobs running on our Mac infrastructure, the ranges are 162.222.72.0/21 (this range also belongs to our infrastructure provider and may contain non-Travis CI hosts) and 208.78.110.192/27.
Please do note that these ranges can change in the future.

Async\Awaitable

The goal of this specification is to define an Awaitable interface for interoperability in PHP.

An Awaitable represents the eventual result of an asynchronous operation. The primary way of interacting with an Awaitable is through its when method, which registers a callback to receive either an Awaitable's eventual value or the reason why the Awaitable has failed. They're basically the same as a Promise in JavaScript's Promises/A+ specification, but the interaction with them is different as the following paragraphs show.

This specification defines an interoperable Awaitable interface for PHP, focussing on its when method. This is required for interoperable co-routines, which can be implemented in PHP using generators. Further methods like a watch method for progress updates are out of scope of this specification. The name Awaitable works well if PHP is extended later to support await and is also alraedy [used in HHVM](htt

@kelunik
kelunik / README.md
Created August 14, 2016 14:30
Documentation Management System

I plan to write a new documentation system, because I couldn't find any system that suites my / our needs at amphp. It has to support multiple packages and their various versions (at least major.minor, bugfix versions will just update the current version). Furthermore, there needs to be support for tutorial series. It's planned to build these from markdown files in ./doc currently.

But we can write as much documentation as we like, the key point is that it must be usable for those that really need the documentation to learn how things work. So I'm asking you here. As a new user of a framework / library / package, what's your preference?

  • What do you need in a documentation system?
  • What is your preferred way for navigation?
  • What should tutorial series look like?

And two more questions if you want to publish your own documentation: