This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am joelhinz on github. | |
* I am joelhinz (https://keybase.io/joelhinz) on keybase. | |
* I have a public key whose fingerprint is 63AF 6064 1A80 DB28 7F95 2EFD 9393 3C45 018E 4679 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class RedirectIndexPhpCalls | |
{ | |
/** | |
* Handle an incoming request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
class Card { | |
constructor(value) { | |
this.value = value; | |
} | |
} | |
class Deck { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
function run() { | |
var piles = _.chunk(_.shuffle(_.range(52).map(i => Math.floor(i/4))), 4); | |
return iterate(piles[0].shift(), piles); | |
} | |
function iterate(hold, piles) { | |
if (_.range(1, 13).every(i => piles[i].length === 0)) return true; | |
if (piles[0].length == 0 && hold === 0) return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// en global helper | |
function stats($object = null) | |
{ | |
$cache = App::make('statistics-cache'); | |
return $object ? $cache->resolve($object) : $cache; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// vanliga arrayer | |
$capitals = []; | |
foreach ($countries as $country) { | |
$capitals[] = $country->capital; | |
} | |
// collections | |
$capitals = $countries->map(function ($country) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$countries->map(function ($country) { | |
return $country->capital; | |
})->reject(function ($capital) { | |
return $capital->isTiny(); | |
})->partition(function ($capital) { | |
return $capital->hasMayor(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// variables | |
$foo = 'bar'; | |
$megafoo = 2345; | |
$superfoo = new AmaziClass(); | |
// class properties | |
class Lingon | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (event) { | |
event.preventDefault(); | |
const activate = document.getElementById(this.dataset.activate); | |
const deactivate = document.getElementById(this.dataset.deactivate); | |
deactivate.classList.add('inactive'); | |
deactivate.classList.remove('active'); | |
setTimeout(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($this->lines as $line) { | |
if (!str_contains($line, ':')) { | |
$this->addError($line, 'No code found'); | |
} else { | |
$this->convertLine($line); | |
} | |
} |
OlderNewer