Skip to content

Instantly share code, notes, and snippets.

View WyriHaximus's full-sized avatar
🐉
Breathing Fire

Cees-Jan Kiewiet WyriHaximus

🐉
Breathing Fire
View GitHub Profile
@frankdejonge
frankdejonge / gist:8234108
Created January 3, 2014 07:14
Ansible setup for MailCatcher.me
---
- name: Commmon | MailUtils
apt: pkg=mailutils state=latest
- name: Commmon | sqlite3
apt: pkg=sqlite3 state=latest
- name: Commmon | libsqlite3-dev
apt: pkg=libsqlite3-dev state=latest
@denji
denji / http-benchmark.md
Last active April 10, 2025 10:01
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@eko
eko / packagist.py
Last active September 25, 2020 13:39
This is a reverse-search for Packagist in order to find which packages is using a package as a dependency
#!/usr/bin/python
#
# This script will provides a reverse-search on Packagist to find which libraries uses a given library package
# as a dependency.
#
# Usage:
# First, you need to fetch dependencies: ./packagist.py --fetch
# After, you can start checking packages: ./packagist.py --package <package-name>
#
# Author: Vincent Composieux <[email protected]>
$buffer = '';
$conn->on('data', function($data, $conn) use (&$buffer) {
$buffer .= $data;
// check to see if the buffer contains any line feeds (detect end of line)
while (false !== ($pos = strpos($buffer, PHP_EOL))) {
// get the first line from the buffer (up to the EOL)
$line = substr($buffer, 0, $pos);
// remove the line from the buffer (advance behind the EOL)
@kyledrake
kyledrake / ferengi-plan.txt
Last active January 10, 2025 14:02
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
var gulp = require('gulp');
var spawn = require('child_process').spawn;
var subprocess;
function refreshGulpfile() {
if (subprocess) subprocess.kill();
subprocess = spawn('gulp', ['watched-default'], {stdio: 'inherit'});
}
gulp.task('default', function () {
<?php
class EnterpriseApi extends Clue\React\Soap\Proxy
{
public function __call($method, $args)
{
if (!in_array($method, array('DoAuthenticateUserWithPlaintextPassword', 'BypassTheAuthenticationFramework', 'debug'))) {
$d = new React\Promise\Deferred();
$d->reject(new \Exception('This is an enterprise API!!11'));
return $d->promise();
@Mikulas
Mikulas / zmq.api.php
Created August 19, 2014 08:24
PHP ZeroMQ Extension API for PhpStorm and other IDEs for autocomplete (zmq 4.0.4)
<?php
/**
* zmq-API v@PACKAGE_VERSION@ Docs build by DocThor [2014-08-19]
* @package zmq
*/
/**
* @package zmq
*/
class ZMQ {
@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);
@jsor
jsor / CoroutineTest.php
Last active July 31, 2017 12:16
React/Promise coroutine
<?php
namespace React\Promise;
class CoroutineTest extends \PHPUnit_Framework_TestCase
{
public function testResolvedValueEqualsFinalYield()
{
$gen = function () {
$a = (yield 21);