Skip to content

Instantly share code, notes, and snippets.

View staabm's full-sized avatar
πŸ‘‹

Markus Staab staabm

πŸ‘‹
View GitHub Profile
<!DOCTYPE>
<html>
<head>
<title>Dissecting Gmail's Email Attachments - Dropping Files</title>
<style>
.msg {
display: none
}
.dragging .msg {
SELECT CONCAT(table_schema, '.', table_name),
ROUND(table_rows / 1000000, 2) rowsInMega,
ROUND(data_length / ( 1024 * 1024 * 1024 ), 2) dataInGiga,
ROUND(index_length / ( 1024 * 1024 * 1024 ), 2) idxInGiga,
ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2) totalSizeInGiga,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 30;
@nikic
nikic / bench.php
Last active December 16, 2024 20:30
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) {
@krakjoe
krakjoe / pthreads.md
Last active February 3, 2026 09:31
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@joyrexus
joyrexus / README.md
Last active March 31, 2026 18:26 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@rxaviers
rxaviers / gist:7360908
Last active April 1, 2026 01:32
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@nikic
nikic / varVar.php
Created June 9, 2014 14:11
Script for finding variable-variable usages potentially affected by uniform variable syntax
<?php
use PhpParser\Node;
use PhpParser\Node\Expr;
error_reporting(E_ALL);
ini_set('memory_limit', -1);
//$dir = __DIR__ . '/../../Symfony_2.3';
@lyrixx
lyrixx / segfault-finder.php
Last active September 23, 2025 16:12
How to find a segfault in PHP
<?php
register_tick_function(function() {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
$last = reset($bt);
$info = sprintf("%s +%d\n", $last['file'], $last['line']);
file_put_contents('/tmp/segfault.txt', $info, FILE_APPEND);
// or
// file_put_contents('php://output', $info, FILE_APPEND);
});
@staltz
staltz / introrx.md
Last active March 24, 2026 13:52
The introduction to Reactive Programming you've been missing