Skip to content

Instantly share code, notes, and snippets.

View ace411's full-sized avatar
🏠
Working from home

Lochemem Bruno Michael ace411

🏠
Working from home
View GitHub Profile
@clue
clue / 2018-04-13 getting-started-with-reactphp-workshop-phpyorkshire.md
Last active December 16, 2023 12:33
Getting started with ReactPHP – Pushing real-time data to the browser (PHPYorkshire)

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

@ace411
ace411 / Basketball.php
Last active May 22, 2017 12:17
Using the fauxton client with Bingo MVC and ReactJS
<?php
/**
* Controller for the CouchDB-React-Bingo project
*
* @package The Bingo Framework
* @author Lochemem Bruno Michael
*/
namespace App\Controllers;
@nicksantamaria
nicksantamaria / fork-example.php
Created October 20, 2016 22:35
Example: Parallel processing in PHP using pcntl_fork()
<?php
/**
* @file
* Basic demonstration of how to do parallel threads in PHP.
*/
// This array of "tasks" could be anything. For demonstration purposes
// these are just strings, but they could be a callback, class or
// include file (hell, even code-as-a-string to pass to eval()).
@pdarragh
pdarragh / Jekyll Static Highlighting Navigation Menu.md
Last active September 30, 2023 10:43
Jekyll navigation bar with automatic highlighting.

Jekyll NavBar

In building a site powered by Jekyll and hosted by GitHub, I wanted the ability to highlight the current page's tab in the bar. I also wanted the bar to support second-level items (i.e. a dropdown), which proved somewhat tricky. This is the solution I arrived at after a few hours of fiddling around.

Construction

The contents of the navigation bar are contained in a data file located at _data/navigation.yml. This makes it accessible via the site-wide Liquid element {{ site.data.navigation}}. You can see the file for the formatting I used.

How it Works

@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@nikic
nikic / php_evaluation_order.md
Last active October 19, 2021 05:47
Analysis of some weird evaluation order in PHP

Order of evaluation in PHP

Yesterday I found some people on my [favorite reddit][lolphp] wonder about the output of the following code:

<?php

$a = 1;
$c = $a + $a++;
@pkriete
pkriete / gist:2425817
Created April 20, 2012 03:52
PHP Tail Recursion
function tailrec($func)
{
$acc = array();
$recursing = FALSE;
$func = new ReflectionFunction($func);
return function() use ($func, &$acc, &$recursing) {
$acc[] = func_get_args();
@millermedeiros
millermedeiros / .vimrc
Last active December 11, 2023 14:44
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ...
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
i
me
my
myself
we
our
ours
ourselves
you
your