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 / readme.md
Created August 11, 2017 14:48
Northeast PHP Hack-a-thon notes

Northeast PHP Hack-a-thon (php-src) 2017

  • Set up GitHub account + add your SSH keys
  • Fork php-src repo to your GitHub account
  • Clone source (or use USB stick) & cd into directory
  • Update origin remote URL with your fork
$ git remote set-url origin {your-fork-URL}
@SammyK
SammyK / Color.php
Created October 5, 2017 21:48
Color RGB matcher
<?php
class Color
{
private $hex;
private $r;
private $g;
private $b;
public function __construct(string $hex) {
@SammyK
SammyK / README.md
Last active August 1, 2018 16:54 — forked from nikic/varVar.php
Script for finding variable-variable usages potentially affected by uniform variable syntax

Find Bugs Related To Uniform Variable Syntax

When upgrading to PHP 7, you might run into really hard-to-debug error messages which might be a result of the uniform variable syntax RFC.

This script (forked from Nikita Popov's gist) will scan a PHP 5 codebase and call out the file and line number of an indirect expression with an offset. The evaluation of these expressions has changed in PHP 7.

Installation

To run this script against a PHP 5 codebase, make sure you have PHP and Composer installed. Then create a directory somewhere and install nikic/php-parser with Composer.

@SammyK
SammyK / invert-binary-tree.php
Created September 6, 2018 21:54
Invert A Binary Tree in PHP (Array Implementation)
<?php
// Similar, but not quite the same as LeetCode problem #226
// @see https://leetcode.com/problems/invert-binary-tree/description/
function invertTree(array $nodes): array
{
$height = (int) floor(log(count($nodes), 2));
$level = 1;
while ($level <= $height) {
$start = 2 ** $level - 1;