Skip to content

Instantly share code, notes, and snippets.

View rvanlaak's full-sized avatar

Richard van Laak rvanlaak

  • Amsterdam, Netherlands
View GitHub Profile
@kayue
kayue / index.php
Created August 25, 2011 07:05
Integrate Symfony 2 with Wordpress
<?php
require_once __DIR__.'/../symfony/app/bootstrap.php.cache';
require_once __DIR__.'/../symfony/app/AppKernel.php';
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$response = $kernel->handle(Request::createFromGlobals());
@daviddesberg
daviddesberg / OverlapCalculator.php
Created August 24, 2012 03:20
Time Interval Overlap Calculator
<?php
/**
* Calculates the amount of overlap between a source time range and a variable number of compared time ranges.
* Implements a subset of Allen's Interval Algebra.
* With contributions by rdlowery.
*/
class OverlapCalculator {
/**
* @var int
@dantleech
dantleech / convert.php
Last active November 23, 2018 13:18
Script to convert symfony YAML translation file to XLIFF
<?php
// Script to convert Symfony YAML translation files to XLIFF.
//
// Will add a .xliff version of the given file in its directory.
//
// $ php convert.php path/to/MyBundle.en.yml
$file = $argv[1];
@nikic
nikic / bench.php
Last active November 2, 2023 22:49
Benchmark of call_user_func_array vs switch optimization vs argument unpacking syntax
<?php error_reporting(E_ALL);
function test() {}
$nIter = 1000000;
$argNums = [0, 1, 2, 3, 4, 5, 100];
$func = 'test';
foreach ($argNums as $argNum) {
@jsor
jsor / ddd_cqrs_event-sourcing_in_php.md
Last active April 23, 2024 19:48
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@iki
iki / README.md
Last active December 12, 2021 08:50 — forked from othiym23/npm-upgrade-bleeding.sh
Update global top level npm packages

Update global top level npm packages

Problem

npm update -g updates all global packages and their dependencies, see npm/npm#6247.

Solution

  1. Either use the shell script or windows batch here instead.
@kandran
kandran / README.md
Last active November 19, 2018 08:28
Use php-cs-fixer with phpstorm file watcher

Auto use php-cs-fixer at save with PHPStorm and file watcher

  1. Open settings ( ctrl + alt + s)
  2. Menu file watchers
  3. Import watchers.xml
  4. Change settings like path for php and php-cs-fixer
  5. Enjoy ! PSRize at save.

NB: File watchers are linked to a specific project, so we have to re-import them for each project. External tools have IDE scope but we couldn't run them automaticaly - we could set a key bind.

@chadrien
chadrien / README.md
Last active July 18, 2024 08:31
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@manigandham
manigandham / rich-text-html-editors.md
Last active June 10, 2024 15:49
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@adamelso
adamelso / platform-sh-inactive-branch-removal.js
Created March 10, 2016 12:15
Remove inactive branch environments from Platform.sh
var deleteBranches = function () {
return $("ul[ng-show='environment.active_trail']")
.first()
.find("li.disabled > div > a")
.map(function (i, b) {
return b.text;
});
};
var filterDeleteBranchesByPrefix = function (prefix) {