Skip to content

Instantly share code, notes, and snippets.

@jm42
jm42 / 140.md
Last active December 24, 2019 14:54
140 bytes of PHP code

140 bytes

  • Framework

    • Twitto - A web framework in a tweet.
    • Kernel - A kernel in a tweet.
    • sized140 - Something like a framework in PHP with 6 components of 140 chars.
  • Router

  • mu - A tweet-sized PHP micro-router.
@mtdowling
mtdowling / gist:47da5eab54337cdc7ecc
Last active August 29, 2015 14:06
React and Guzzle experiment
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Stream\BufferStream;
use GuzzleHttp\Stream\AsyncReadStream;
use GuzzleHttp\Ring\Future;
$loop = React\EventLoop\Factory::create();
$dnsResolverFactory = new React\Dns\Resolver\Factory();
$dnsResolver = $dnsResolverFactory->createCached('8.8.8.8', $loop);
@Ocramius
Ocramius / BlogPostHydrator.php
Last active August 17, 2017 11:50
Association lazy-loading with Zend\Db
<?php
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
use Zend\Stdlib\Hydrator\HydratorInterface;
class BlogPostHydrator implements HydratorInterface
{
/**
* @var HydratorInterface
*/
@mala
mala / gist:61a2eef2833bfef0456b
Created June 12, 2014 12:49
RFC7231のリファラに関するメモ
https://twitter.com/bulkneets/status/476343189717012480
をきっかけにリファラにabout:blankが提案された経緯について調べていた。
単にnull値として使えると定義されただけで、現状積極的に送れと推奨されているわけではないと認識している。
この変更で https://trac.tools.ietf.org/wg/httpbis/trac/changeset/2072
「about:blank送る or 全く送らない」と書かれていたのが「全く送らない or about:blank送る」と順番逆になったりしている。
----
RFC7231のリファラに関するメモ
@mwillbanks
mwillbanks / ZF3Sessions.md
Last active August 29, 2015 14:02
Some ideas around sessions

Sessions

Zend Framework 3 (ZF3) will provide a new session management layer that will decouple it from ext/session. In doing this we will allow you to run multiple sessions at the same time in an application, utilize sessions in long-running applications, compatibility/convertibility with other applications, languages, etc.

With decoupling ext/session we will also provide a compatibility layer that will allow you to continue to utilize ext/session and the super global $_SESSION thus allowing you to continue with like behavior as you would have come to expect with generic session management in PHP.

In Zend Framework 2 (ZF2), we encountered numerous issues throughout the session management layer. Certain compatibility issues with ext/session specifically relating to session uploads. Session uploads caused corruption to the internal handing of sessions generally due to it's attempt to rewrite the session data. We also encountered several issues with PHP itself specifically regarding the usage

@Kimundi
Kimundi / java_rust_generic.md
Last active March 20, 2024 06:02
A light comparison between Rust and Java generics and type system features.

Introduction

If you are familiar with Java's generics, and are coming to Rust, you might be lead to assume that its generics are working the same way.

However, due to the different type systems, and different implementation details, there are quite a few differences between generic code in both languages.

This document tries to give a short summary about those differences:

Core functionality

Java

@DaSourcerer
DaSourcerer / httpget
Last active December 27, 2015 09:29
A simple stream-based http client. Good for experimentation.
#!/usr/bin/php
<?php
$scheme='tcp';
$host='www.kernel.org';
$port=80;
$path='/';
if(isset($argv[1])) {
$parsedUrl=parse_url($argv[1]);
@krakjoe
krakjoe / pthreads.md
Last active August 30, 2023 18:30
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@ircmaxell
ircmaxell / README.md
Last active December 18, 2015 12:19
Compare Modified GC

To set this up, have 2 builds of PHP, one using the "master" branch, and one using my refactor branch. Configure the paths to the SAPI at the top of benchmark.php.

Note that it's hard-coded to look for php-src/Zend/bench.php, php-src/Zend/micro_bench.php and gc_test.php.

@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub"