Skip to content

Instantly share code, notes, and snippets.


Mark Friedrich exodus4d

View GitHub Profile
clue / 2018-04-13
Last active Jun 22, 2020
Getting started with ReactPHP – Pushing real-time data to the browser (PHPYorkshire)
View 2018-04-13

Think about "PHP" for a few seconds… What came to mind? It’s very likely you thought about your average product catalog, a blogging platform or how the platform is inferior to things like Node.js. But wait, it’s 2018! What if I told you PHP’s huge ecosystem has way more to offer and PHP is not inferior at all to its evil cousin Node.js?

Hands-on workshop given at PHPYorkshire (2018-04-13)

Getting started with ReactPHP – Pushing real-time data to the browser

In this hands-on tutorial you will learn about the core concepts of async PHP and why you too should care about ReactPHP being a real thing. The workshop has a strong focus on sparking the idea that PHP can be way faster and more versatile than you probably thought. Bring along an open mind and through lots of interesting examples and live demos learn why what sounds crazy at first might soon be a valuable addition in your toolbox.

You’re already familiar with PHP and want to learn what ReactPHP is all about? Then this tutorial is for you! We will

View es6-abstract-class-example.js
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if ( === {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");
jesstelford / Links in
Last active Jul 30, 2021
Putting links in code blocks on GitHub
View Links in
johnantoni / gist:07df65898456ace4307d5bb6cbdc7f51
Last active Jun 29, 2021 — forked from mgmilcher/gist:5eaed7714d031a12ed97
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X
View gist:07df65898456ace4307d5bb6cbdc7f51

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)


Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install
h2non / ancestors.js
Created Feb 6, 2015
Recursively inspect the prototype chain inheritance of a given object in JavaScript (inspired in Ruby's Class.ancestors)
View ancestors.js
// Under WTFPL license ;)
function ancestors(obj) {
var hierarchy = [];
if (['boolean', 'number', 'string', 'undefined'].indexOf(typeof obj) !== -1 || obj === null) { // primitives types
obj = Object(obj);
} else if (typeof obj === 'function') {
hierarchy.push( ||
(obj.toString().match(/function (\w*)/) ||
obj.toString().match(/\[object (\w*)\]/))[1] ||
p3t3r67x0 /
Last active Oct 22, 2021
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;

video /deep/ input[type=range] {
taivo / x-editable-radiolist
Last active Mar 2, 2019
radiolist support for x-editable
View x-editable-radiolist
List of radio buttons. Unlike checklist, value is stored internally as
scalar variable instead of array. Extends Checklist to reuse some code.
@class radiolist
@extends checklist
<a href="#" id="options" data-type="radiolist" data-pk="1" data-url="/post" data-title="Select options"></a>
sokratisg / sysctl.conf
Last active Jun 24, 2021
Tuned sysctl.conf for use by CentOS/RHEL 6.x or later
View sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Turn on execshield
# 0 completely disables ExecShield and Address Space Layout Randomization
# 1 enables them ONLY if the application bits for these protections are set to “enable”
# 2 enables them by default, except if the application bits are set to “disable”
# 3 enables them always, whatever the application bits
branneman / call-apply-bind-proxy.js
Last active Jul 7, 2021
JavaScript call() vs apply() vs bind() vs $.proxy()
View call-apply-bind-proxy.js
var fn = function(arg1, arg2) {
var str = '<p>aap ' + this.noot + ' ' + arg1 + ' ' + arg2 + '</p>';
document.body.innerHTML += str;
var context = {
'noot': 'noot'
var args = ['mies', 'wim'];
// Calls a function with a given 'this' value and arguments provided individually.
jaseemabid / objects.js
Created Aug 23, 2011 — forked from kaaes/objects.js
ECMA5 object cheatsheet
View objects.js
* Object descriptor
var a = {
prop1 : 14
var descriptorObj1 = Object.getOwnPropertyDescriptor(a, 'prop1');