Skip to content

Instantly share code, notes, and snippets.

View kaecyra's full-sized avatar

Tim Gunter kaecyra

View GitHub Profile
What it is
function createTOC() {
var list = document.getElementByTagName("UL")[0];
var headingText
var TOCEntry
for (i = 0; i <= 10; i++) {
headerText = document.getElementById(i).innerHTML;
TOCEntry = document.createElement("li")
TOCEntry.innerHTML = "<a href=#" + i + ">" + headingText + "</a>";
list.appendChild(TOCEntry);
}
<?php
function randomString($length, $characterOptions = 'A0') {
$characterClasses = array(
'A' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'a' => 'abcdefghijklmnopqrstuvwxyz',
'0' => '0123456789',
'!' => '~!@#$^&*_+-'
);
<?php
/**
* @license Proprietary
* @copyright 2009-2016 Vanilla Forums Inc.
*/
namespace Vanilla\ProductQueue\Job;
use Vanilla\ProductQueue\Job\AbstractJob;
icarus:~ icyliquid$ ab -n 100 -c 2 http://nowaf.vanillatesting.com/
Benchmarking nowaf.vanillatesting.com (be patient).....done
Server Software: nginx
Server Hostname: nowaf.vanillatesting.com
Server Port: 80
Document Path: /
Document Length: 7464 bytes
icarus:~ icyliquid$ ab -n 100 -c 2 https://withwaf.vanillatesting.com/
Benchmarking withwaf.vanillatesting.com (be patient).....done
Server Software: nginx
Server Hostname: withwaf.vanillatesting.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,4096,256
Document Path: /
### Keybase proof
I hereby claim:
* I am kaecyra on github.
* I am timgunter (https://keybase.io/timgunter) on keybase.
* I have a public key whose fingerprint is C2B0 F483 10E6 BA22 E379 A611 DBB2 45F0 F584 AC5B
To claim this, I am signing this object:
<?php
if ($state->have(['spit', 'hot', 'fire'], true)) {
$emotes = [
'(celeryman)',
'(banks)',
'(dance)',
'(gangnamstyle)',
'(danceman)',
'(boom)',
@kaecyra
kaecyra / testphp.php
Last active November 17, 2015 21:15
Syntax check all PHP files in a folder
#!/bin/bash
me=`basename $0`
if [ $# -lt 1 ]; then
echo "Usage: $me [-q] <folder>"
exit 1;
fi
quick=false
if [ "$1" = "-q" ]; then