Skip to content

Instantly share code, notes, and snippets.

View HSPDev's full-sized avatar

Henrik Sylvester Oddergaard HSPDev

View GitHub Profile
includes:
- ./vendor/nunomaduro/larastan/extension.neon
parameters:
level: 7
ignoreErrors:
#I can't imagine an instance where our logger would return null.
- "#Cannot call method warning() on Illuminate\\Log\\LogManager|null.#"
#I think it doesn't know about the Macro for "Locks" on Cache, but it works.
- '#Call to an undefined method Illuminate\\Contracts\\Cache\\Repository::lock().#'
@HSPDev
HSPDev / AllowSSHFromIP.php
Created July 2, 2018 22:56
Complementary code and IAM policy for "You don't need that Bastion host"
<?php
// For laravel 5 based systems
// /path/to/project/app/Console/Commands/AllowSSHFromIP.php
namespace App\Console\Commands;
use Aws\Ec2\Ec2Client;
use Carbon\Carbon;
use Illuminate\Console\Command;

Keybase proof

I hereby claim:

  • I am HSPDev on github.
  • I am hsp (https://keybase.io/hsp) on keybase.
  • I have a public key whose fingerprint is 0F83 1D3F 3279 1846 E6BB 6F68 FB0B 2EB3 301D 0DE2

To claim this, I am signing this object:

@HSPDev
HSPDev / gist:9217449296637206f63a
Last active August 29, 2015 14:26
Password rehashing in PHP
<?php
$password = 'rasmuslerdorf';
$hash = '$2y$10$YCFsG6elYca568hBi2pZ0.3LDL5wjgxct1N8w/oLR/jfHsiQwCqTS';
// The cost parameter can change over time as hardware improves
$options = array('cost' => 11);
// Verify stored hash against plain-text password
if (password_verify($password, $hash)) {
// Check if a newer hashing algorithm is available