Skip to content

Instantly share code, notes, and snippets.

View realityking's full-sized avatar

Rouven Weßling realityking

View GitHub Profile
@realityking
realityking / node-sass-stats.js
Last active October 24, 2019 13:11
node-sass download stats
'use strict';
const json = require('./stats.json');
const table = require('markdown-table');
function getHumanNodeVersion(abi) {
switch (parseInt(abi, 10)) {
case 11: return 'Node 0.10.x';
case 14: return 'Node 0.12.x';
case 42: return 'io.js 1.x';
@realityking
realityking / webhook.js
Created September 6, 2017 12:38
Simple webhook receiver
'use strict';
const hapi = require('hapi');
const server = new hapi.Server();
// Tell our server that it will listen on port 3001
server.connection({ port: 3001 });
// Setup the route for our webhook
@realityking
realityking / index.js
Created September 4, 2017 18:42
Count slack messages by bot in a channel
'use strict';
const WebClient = require('@slack/client').WebClient;
const TOKEN = process.env.SLACK_TOKEN;
const CHANNEL_NAME = 'cofftentful';
const BOT_ID = 'B4XNQQK3M';
const web = new WebClient(TOKEN);
@realityking
realityking / magic.js
Created July 7, 2017 21:13
Lyn posing weird questions
'use strict';
var table1 = [
[{content: 'r0c0'}, {content: 'r0c1'}, {content: 'r0c2', colSpan: 2, rowSpan: 3}, {content: 'r0c4'}],
[{content: 'r1c0', colSpan: 2, rowSpan: 2}, {content: 'r1c4'}],
[{content: 'r2c4'}],
[{content: 'r3c0'}, {content: 'r3c1'}, {content: 'r3c2'}, {content: 'r3c3'}, {content: 'r3c4'}]
];
var table2 = [
@realityking
realityking / .clang-format
Created February 4, 2016 10:11
Clang Format for PHP config
---
Language: Cpp
IndentWidth: 4
TabWidth: 4
UseTab: ForIndentation
AlignConsecutiveAssignments: true
BreakBeforeBraces: Linux
ColumnLimit: 0
MacroBlockBegin: '^ZEND_BEGIN_ARG_INFO'
MacroBlockEnd: '^ZEND_END_ARG_INFO'
/* {{{ proto void register_shutdown_function(callback function) U
Register a user-level function to be called on request termination */
PHP_FUNCTION(register_shutdown_function)
{
php_shutdown_function_entry shutdown_function_entry;
int i;
zval ***args = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &shutdown_function_entry.arg_count) == FAILURE) {
<?php
$utf8_s = 'Iñtërnâtiônàlizætiøn';
$ascii_s = 'Internationalisation';
$utf8_m = 'Geocaching, auch GPS-Schnitzeljagd genannt, ist eine Art elektronische Schatzsuche oder Schnitzeljagd. Die Verstecke („Geocaches“, kurz „Caches“) werden anhand geografischer Koordinaten im World Wide Web veröffentlicht und können anschließend mit Hilfe eines GPS-Empfängers gesucht werden. Mit genauen Landkarten ist auch die Suche ohne GPS-Empfänger möglich. Ein Geocache ist in der Regel ein wasserdichter Behälter, in dem sich ein Logbuch sowie verschiedene kleine Tauschgegenstände befinden. Jeder Besucher trägt sich in das Logbuch ein, um seine erfolgreiche Suche zu dokumentieren. Anschließend wird der Geocache wieder an der Stelle versteckt, an der er zuvor gefunden wurde. Der Fund wird im Internet auf der zugehörigen Seite vermerkt und gegebenenfalls durch Fotos ergänzt. So können auch andere Personen – insbesondere der Verstecker oder „Owner“ – die Geschehnisse rund um den Geocache verfolgen. Weltweit existieren über 2
Accept the following values:
-Any callable, i.e. 'my_callback_function'
-A string containing either
-just the class (is ControllerInterface is implemented) - behaves like it does right now
-or in the Syntax Class:Method - will create an instance of class and call method
@realityking
realityking / definitions.php
Created December 16, 2015 16:54
PHP Unified Symbol Table Example
<?php
class TestClass
{
public $prop = 'hello';
}
function test_function($a)
{
return $a;

The decoupled Symfony components have been a great help but there are a few things in FrameworkBundle that could be moved to the components with some small refactoring making them more useable for people like me who have to use the components without the full framework.

There's a pretty good chance I'm overlooking something with some of these and there are certainly backwards compatibility concerns to be adressed.

Let's dig in:

Router and RouterCacheWarmer

The warmUp() method from the Router class could be dropped (also the WarmableInterface), the code would move RouterCacheWarmer. With this change RouterCacheWarmer only depends on HttpKernel and Routing and could go into either of these components. (My favorite would be Routing)