Skip to content

Instantly share code, notes, and snippets.

View SammyK's full-sized avatar
🐶
Meredith Palmer Memorial Celebrity Rabies Awareness ProAm FunRun Race 4 The Cure

Sammy Kaye Powers SammyK

🐶
Meredith Palmer Memorial Celebrity Rabies Awareness ProAm FunRun Race 4 The Cure
View GitHub Profile
@SammyK
SammyK / random_hex.c
Last active August 29, 2015 14:15
Ripped this out of the PHP CRPRNG PR since it got no love! :'(
// Copy/pasted from string.c
static char hexconvtab[] = "0123456789abcdef";
// Copy/pasted from string.c
static zend_string *php_bin2hex(const unsigned char *old, const size_t oldlen)
{
zend_string *result;
size_t i, j;
result = zend_string_safe_alloc(oldlen, 2 * sizeof(char), 0, 0);

Keybase proof

I hereby claim:

  • I am SammyK on github.
  • I am sammyk (https://keybase.io/sammyk) on keybase.
  • I have a public key whose fingerprint is AD0B 4822 0571 049A D52C 995E 0D8B 1EF3 853E 00F4

To claim this, I am signing this object:

@SammyK
SammyK / php-function-header.md
Created August 25, 2014 18:09
Possible PHP RFC? Call function based on function header

I don't know enough about how programming languages work to even know what this is called. But when working on an event emitter, I thought it'd be cool if PHP would be able to support this:

class FooClass {
  function bam() { echo 'BAM!'; }
}

function foo(array $bar = []) {
  print_r($bar);
}
@SammyK
SammyK / the-modern-php-developer.md
Last active April 7, 2017 03:19
Gone is the age of procedural WordPressy web apps in PHP. The modern PHP developer grabs best practices by the horns to be a coding badass.

The Modern PHP Developer

If you want to be a respectable PHP programmer in this age, make sure you know about a few important things!

PHP Framework Interoperability Group (FIG) Standards

Familiarize yourself with PSR standards. The most important one is PSR-0 as it changed the way PHP is coded in version 5.3.