Skip to content

Instantly share code, notes, and snippets.

preset: psr2
risky: false
enabled:
- short_array_syntax
- align_equals
- align_double_arrow
finder:

Keybase proof

I hereby claim:

  • I am mcneely on github.
  • I am mcneely (https://keybase.io/mcneely) on keybase.
  • I have a public key ASALsPXAAv2LOIE1ApE8dxwltfLBFA2AN0T7L2iy3lipXQo

To claim this, I am signing this object:

@mcneely
mcneely / advent_2.php
Created December 2, 2017 17:35
AOC Day 2
<?php
$string= "5 9 2 8
9 4 7 3
3 8 6 5";
$rows = explode("\n", $string);
$checksum1 = $checksum2= 0;
foreach ($rows as $row) {
$row = explode("\t", $row);
$checksum1 += (max($row) - min($row));
@mcneely
mcneely / Advent_1.php
Last active December 2, 2017 17:37
AOC Day 1
<?php
$strInput = "1212";
$arrInput = str_split($strInput);
function calc($arrInput, $steps = 1)
{
$count = 0;
foreach ($arrInput as $key => $value) {
$next = $key + $steps;
$arrCnt = count($arrInput) - 1;