Skip to content

Instantly share code, notes, and snippets.

View beck24's full-sized avatar
🍁
Canadian

Matt Beckett beck24

🍁
Canadian
View GitHub Profile
@beck24
beck24 / output.txt
Created February 22, 2017 01:31
memory usage test output
[Wed Feb 22 01:19:20.356158 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 13369344
[Wed Feb 22 01:19:20.626534 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 13369344
[Wed Feb 22 01:19:25.449852 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 13893632
[Wed Feb 22 01:19:30.349786 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 14155776
[Wed Feb 22 01:19:35.371166 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 14155776
[Wed Feb 22 01:19:39.386531 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 14417920
[Wed Feb 22 01:19:43.461118 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 14680064
[Wed Feb 22 01:19:47.408901 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 14942208
[Wed Feb 22 01:19:51.338597 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 14942208
[Wed Feb 22 01:19:54.673032 2017] [:error] [pid 8173] [client 10.0.2.2:60532] memory usage: 15204352
@beck24
beck24 / test.php
Created November 29, 2014 00:18
ElggBatch performance test
<?php
require_once __DIR__ . '/engine/start.php';
echo 'tail your log file';
// Ignore user aborts and allow the script to run forever
ignore_user_abort(true);
session_write_close();
set_time_limit(0);
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u= "https://dev.griffingroups.com/piwik/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", 1]);
@beck24
beck24 / script match
Created November 27, 2012 23:40
preg_match_all <script></script> match
<?php
$html = <<<HTML
<html>
<head>
<script src="http://example.com"></script>
</head>
<body>
<div>
<script>
@beck24
beck24 / embedextender_hookdemo.php
Created May 15, 2012 02:59
embed_extender hooks demo
<?php
function au_landing_init(){
// provide custom video handling for au.teacherstv and slideshare
// these hooks are provided by my latest pull request
// custom_patterns gathers regex patterns to select urls
// custom_embed provides the embed code if a pattern is matched
elgg_register_plugin_hook_handler('embed_extender', 'custom_patterns', 'au_landing_embed_patterns');
elgg_register_plugin_hook_handler('embed_extender', 'custom_embed', 'au_landing_embed');
}