Skip to content

Instantly share code, notes, and snippets.

View AshleyPinner's full-sized avatar

Ashley Pinner AshleyPinner

  • Poole, United Kingdom
View GitHub Profile
EventName Additional Info Example JSON
GameStart Always first event { "EventID": 0, "EventName": "GameStart", "EventTime": 0.048362601548433307}

Blues Buildings:

Towers

TurretKilled Lane Position
Turret_T2_L_03_A Top Outer
Turret_T2_C_05_A Mid Outer
Turret_T2_R_03_A Bot Outer
Turret_T2_L_02_A Top Inner
# fdisk -lu /dev/sdb
Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
@AshleyPinner
AshleyPinner / test.php
Last active August 29, 2015 14:28
The fun of cygwin and /dev/urandom (See comments, possibly MinGW related)
<?php
var_dump(is_readable('/dev/urandom'));
var_dump(passthru('head /dev/urandom'));
var_dump(PHP_OS);
?>
Sample output:
bool(false)
@AshleyPinner
AshleyPinner / gist:f2230ae8307e2f05149c
Created October 7, 2014 11:44
Rough replacement for cal_days_in_month for HHVM
if(!function_exists('cal_days_in_month')) {
function cal_days_in_month($calendar, $month, $year) {
return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);
}
if (!defined('CAL_GREGORIAN')) {
define('CAL_GREGORIAN', 1);
}
}
<?php
/*
Challenge 7: Snail print an array
Rules::
1. No Exceptions or PHP errors / warnings notices allowed
2. No redefining the test arrays.
3. Your function must be able to cope with n by n arrays as input