Skip to content

Instantly share code, notes, and snippets.

@shadowhand
shadowhand / session-life-cycle.md
Created November 29, 2016 19:22 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@shadowhand
shadowhand / ddd_cqrs_event-sourcing_in_php.md
Created October 18, 2016 14:38 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
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
# Starts server in current folder
tell application "Finder"
set currentDir to POSIX path of ((container of (path to me)) as text)
end tell
tell application "Terminal" to activate
tell application "Terminal"
do script ("cd '" & currentDir & "'")
import json
import os
import requests
GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN')
if GITHUB_TOKEN is None:
raise Exception('Missing GITHUB_TOKEN from os.environ')
@shadowhand
shadowhand / 0_reuse_code.js
Created May 17, 2014 00:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
require_once('Mustache.php'); // Ensure feature/higher-order-sections branch !!
class MyMustache extends Mustache {
public function name()
{
return "Luke";
}
@shadowhand
shadowhand / custom.css
Created January 8, 2011 02:49 — forked from isaiahdw/gist:769660
Kohana Framework Forum Theme for Vanilla 2
body { background: #f1f8db; }
#Body {
margin: 15px 0 0;
overflow: visible;
padding: 0 15px;
position: relative;
width: auto;
}
<?php
$files = glob('/Users/wgilk/Desktop/calls/*.csv');
$data = array();
foreach ($files as $file)
{
$csv = fopen($file, 'r');
# default server
server {
listen 80;
server_name local.kohanaphp.com;
root /Volumes/Webserver/Checkout/projects/kohana/v3;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ index.php$uri;
<?
// Ensure we're dealing with local
return (bool) filter_var($ip_address, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_IPV4);