Skip to content

Instantly share code, notes, and snippets.

[30-Sep-2013 13:08:46.875542] DEBUG: pid 794, fpm_got_signal(), line 76: received SIGCHLD
[30-Sep-2013 13:08:46.875605] WARNING: pid 794, fpm_children_bury(), line 252: [pool www] child 10202 exited on signal 11 (SIGSEGV) after 116.726905 seconds from start
[30-Sep-2013 13:08:46.878376] NOTICE: pid 794, fpm_children_make(), line 421: [pool www] child 10243 started
[30-Sep-2013 13:08:46.878439] DEBUG: pid 794, fpm_event_loop(), line 419: event module triggered 1 events
class Test {
use Overload;
public function __construct() {
self::add('test', function($a, $b, $c = false) {
echo '2-3 args: a => ', $a, ' b => ', $b, ' c => ', $c, PHP_EOL;
});
self::add('test', function() {
@martinamps
martinamps / ko_sendpackets.cpp
Created January 16, 2015 19:49
old code sample of injecting packets into KO
DWORD KO_SEND_FUNC = 0x473430; //0x4736C0;
DWORD KO_SOCKET_BMA = 0xB6D790; //0xB6D770;
std::vector<char> hex2bytes(std::string hex) {
std::vector<char> out;
std::istringstream s;
int b;
for (int i = 0; i < hex.length(); i += 2) {
s.clear();
enum Attribute: string {
UINT = 'sql_attr_uint';
BOOL = 'sql_attr_bool';
BIGINT = 'sql_attr_bigint';
TIMESTAMP = 'sql_attr_timestamp';
STR2ORDINAL = 'sql_attr_str2ordinal';
FLOAT = 'sql_attr_float';
MULTI = 'sql_attr_multi';
STRING = 'sql_attr_string';
STR2WORDCOUNT = 'sql_attr_str2wordcount';
@martinamps
martinamps / gist:6c710aaa9ebd3af3953f
Created November 21, 2015 16:15
Facebook: Monitoring at 250 gbit/s
Monitoring Challenges
Collect monitoring data
Snapshot of system, monitoring changes over time
Hard at scale
Analyze monitoring data
Hard to do fast/effiicienly.
@martinamps
martinamps / gist:c290bc01454d3c1b8c39
Created November 21, 2015 16:15
Google: The motivation for a monolithic codebase
Rachel Potvin - Engineering Manager
Started career in video game industry.
Company work on multiple games at once
One game per repo
One copy of game engine in each repo + diverge
Features would be wanted between diverged game engines, and the merge conflicts ensue.
#include <Tlhelp32.h>
#include "DInput.h"
DWORD DInputMod;
DWORD DINPUT_K_1;
DWORD DINPUT_K_2;
DWORD DINPUT_K_3;
DWORD DINPUT_K_4;
@martinamps
martinamps / gist:7168ec5cfaf861aa2f29afbca2549073
Created July 12, 2017 01:07
Twilio Functions blacklist example
const got = require('got');
const crypto = require('crypto');
const blacklist = [
'cnn is isis',
'side of beef',
];
const blacklist_replies = [
"Message: GOTO is not allowed in a stored procedure handler",
print("hello")
This file has been truncated, but you can view the full file.
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=275)}([function(e,t,n){"use strict";e.exports=n(276)},function(e,t){e.exports=function(e){return e&&e.__esModule?e