Skip to content

Instantly share code, notes, and snippets.

Avatar

Niklas Keller kelunik

View GitHub Profile
View MethodNotAllowedExceptionDemo
<?php
set_include_path(__DIR__."/../:.");
require('autoload.php');
require('functions.php');
require('Libraries/Tpl.php');
use Arya\Request;
use Arya\Response;
View ea.Client.json
[
{
"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 Dec 9, 2014
Remove w3schools.com from Google Search results
View remove-w3schools-from-google-search.user.js
// ==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) {
View php.sh
#!/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 Mar 10, 2016
X1C Install
View setup.sh
#!/bin/bash
# re-run as root if necessary
if [[ $EUID -ne 0 ]]; then
sudo ./$0
exit
fi
# apt-get install -y acpi
View github-conversations.user.js
// ==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 Aug 29, 2015
Docker PHP 7
View Dockerfile
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
View travis-ip-ranges.txt
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.
View Awaitable.md

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 Aug 14, 2016
Documentation Management System
View README.md

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: