Skip to content

Instantly share code, notes, and snippets.

Anthony Chambers Antnee

  • Nottinghamshire
Block or report user

Report or block Antnee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Antnee
Antnee / strace.txt
Last active Nov 19, 2019
Slow Xdebug 2.8.0 Strace
View strace.txt
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
29.16 0.034135 2 20437 9 open
19.65 0.022995 1 20456 close
14.39 0.016840 1 25138 10055 access
8.61 0.010082 1 14542 poll
6.81 0.007972 1 5622 45 stat
4.65 0.005440 1 10127 17 lstat
4.26 0.004985 0 11774 write
4.08 0.004771 1 3333 getdents
@Antnee
Antnee / password_hash_cost_calculator.php
Created Feb 29, 2016
PHP password_hash() cost calculator
View password_hash_cost_calculator.php
<?php
/**
* Password Hash Cost Calculator
*
* Set the ideal time that you want a password_hash() call to take and this
* script will keep testing until it finds the ideal cost value and let you
* know what to set it to when it has finished
*/
// Milliseconds that a hash should take (ideally)
@Antnee
Antnee / generator_return_types.php
Last active Sep 3, 2017
PHP 7 Generator Return Type
View generator_return_types.php
<?php
class Item {
private $id;
public function __construct(int $id)
{
$this->id = $id;
}
public function id() : int
{
@Antnee
Antnee / Vagrantfile
Last active Nov 23, 2017
Vagrant PHP 7 Apache 2.4 XDebug
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
View php7_structs.php
<?php
/**
* Ideas for how I'd like to see structs implemented in PHP7
*
* In this example, structs are more like lightweight objects that have no
* methods, just properties. They can be "instantiated" and all properties will be
* null until defined later, as per classes. It is however not possible to set a
* value to a property that was not defined in the struct originally.
*
* Structs can extend other structs, much like classes can. Properties can also
You can’t perform that action at this time.