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 Finagin; | |
use Finagin\Traits\Readable; | |
use Finagin\Traits\TraitBootstrapper; | |
class Example | |
{ | |
use Readable, TraitBootstrapper; |
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 declare(strict_types=1); | |
if (!function_exists('dump')) { | |
function dump(...$args) | |
{ | |
ob_start(); | |
var_dump($args); | |
file_put_contents('/tmp/igor.manual.log', ob_get_clean()); | |
} | |
} |
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 | |
function dits(int $int, $min = 1): int | |
{ | |
for($i = $min; $int > 1 << $i; $i++); | |
return ++$i; /* "minus" bit */ | |
} | |
echo dits(9999999999999).'bits'; /* 45bits*/ |
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
server { | |
listen 80; | |
server_name ~^(.+)\.dev$; | |
set $path $1; | |
if ($host ~ "([^\.]+)\.[^\.]+$") { | |
set $path $1; | |
} | |
root /var/www/$path; |
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
#!/usr/bin/env php | |
<?php | |
function check(string $password): int | |
{ | |
$hash = strtoupper(hash('sha1', $password)); | |
$start = substr($hash, 0, 5); | |
$content = file_get_contents('https://api.pwnedpasswords.com/range/'.$start); |
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; | |
use Finagin\Support\Singleton; | |
class Instance extends Singleton | |
{ | |
protected function __construct() | |
{ |
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
for (var i = 0, l; ; = log[i]; ++i) { |
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
#!/usr/bin/env php | |
<?php | |
function crow($dir = __DIR__) | |
{ | |
$items = scandir($dir); | |
foreach ($items as $item) { | |
if (! preg_match('/^\.{1,2}$/', $item)) { | |
$path = $dir.DIRECTORY_SEPARATOR.$item; |
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
#!/bin/bash | |
echo "Testing sudo..." | |
sudo true | |
if [ $? -ne 0 ] | |
then | |
echo "ERROR: You must be able to sudo to run this script."; | |
exit 1; | |
fi; |
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; | |
use Illuminate\Notifications\Notifiable; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
class User extends Authenticatable | |
{ | |
use Notifiable; |