This file contains hidden or 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 | |
final class FindUserByIdHandler | |
{ | |
private UserRepository $userRepository; | |
public function __construct(UserRepository $userRepository) | |
{ | |
$this->userRepository = $userRepository; | |
} |
This file contains hidden or 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 | |
class Node | |
{ | |
/** @var string */ | |
public $name; | |
/** @var bool */ | |
public $visited = false; | |
public function __construct(string $name) |
This file contains hidden or 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 | |
use Psr\Log\LoggerInterface; | |
class LoggerInstance | |
{ | |
private static $instance; | |
public static function instance(): LoggerInterface | |
{ | |
if(self::$instance === null) { |
This file contains hidden or 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
install: | |
- if [[ $TRAVIS_PHP_VERSION = nightly ]]; then export COMPOSER_FLAGS="--ignore-platform-reqs"; fi | |
- travis_retry composer update --prefer-dist $COMPOSER_FLAGS |
This file contains hidden or 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 | |
/** | |
* Uses https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel | |
* But it gives you 10 minutes, so you have time to defecate first. | |
*/ | |
if (!function_exists('dddd')) { | |
function dddd(...$arguments) { | |
sleep(600); | |
return ddd(...$arguments); |
This file contains hidden or 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
if ('serviceWorker' in navigator) { | |
window.addEventListener('load', function() { | |
navigator.serviceWorker.register('/sw.js').then( | |
function (serviceWorkerRegistration) { | |
console.log('service worker has been registered, attempting to register push manager'); | |
if (!('PushManager' in window)) { | |
console.log('This browser does not support push notifications'); | |
return; | |
} | |
serviceWorkerRegistration.pushManager.subscribe().then( |
This file contains hidden or 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 getRandomColor(){for(var o="#",n=0;n<6;n++)o+="0123456789ABCDEF"[Math.floor(16*Math.random())];return o}function setColor(){document.body.style.backgroundColor=getRandomColor()}document.body.innerHTML="",setInterval(setColor,0); |
This file contains hidden or 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 | |
$days = ($month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year %400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31)); //returns days in the given month |
This file contains hidden or 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
@import "http://mal-image.appspot.com/all/fluffyyqt"; | |
.animetitle { | |
display: inline-block; | |
font-weight: bold; | |
margin: 2px; | |
} |
This file contains hidden or 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
// ==UserScript== | |
// @name MAL random | |
// @version 3 | |
// @description picks random anime/manga from your MAL animelist/mangalist pages | |
// @author IA21 | |
// @match https://myanimelist.net/mangalist/* | |
// @match https://myanimelist.net/animelist/* | |
// @grant none | |
// ==/UserScript== |