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\Services; | |
use UnexpectedValueException; | |
use Firebase\JWT\JWT; | |
use Illuminate\Support\Facades\Cache; | |
use Illuminate\Support\Facades\Http; | |
use Illuminate\Support\Str; |
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
require 'base64' | |
require 'httparty' | |
require 'jwt' | |
class FirebaseToken | |
JWT_ALGORITHM = 'RS256'.freeze | |
PUBLIC_KEY_URL = 'https://www.googleapis.com/robot/v1/metadata/x509/[email protected]'.freeze | |
def initialize(token) | |
@token = token |
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
{ | |
"Profiles": [ | |
{ | |
"Working Directory": "/Users/ryuta", | |
"Prompt Before Closing 2": 0, | |
"Selected Text Color": { | |
"Green Component": 0.5648583769798279, | |
"Blue Component": 0.5636365413665771, | |
"Red Component": 0.5059919357299805 | |
}, |
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 | |
class OrderServiceProvider extends ServiceProvider | |
{ | |
public function register() | |
{ | |
$this->app->bind(OrderProcessor::class, function ($app) { | |
new OrderProcessor( | |
[ | |
new OrderHasAmount, |
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 | |
class OrderProcessor | |
{ | |
public function __construct(array $validators, OrderNotificationInterface $notification) { | |
$this->$validators = $validators; | |
$this->notification = $notification; | |
} | |
public function process(Order $order) |
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 | |
interface OrderValidationInterface | |
{ | |
public function validate(Order $order) : void; | |
} | |
class OrderHasAmount implements OrderValidationInterface | |
{ | |
public function validate(Order $order) : void |
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 | |
interface OrderNotificationInterface | |
{ | |
public function notify(Order $order) : void; | |
} | |
class SlackNotification implements OrderNotificationInterface | |
{ | |
public function __construct(Slack $slack) { |
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 | |
class OrderProcessor | |
{ | |
public function __construct(Slack $slack) { | |
$this->slack = $slack; | |
} | |
public function process(Order $order) | |
{ |
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
require 'minitest/autorun' | |
class Matrix | |
# @param {Integer[][]} matrix | |
# @return {Boolean} | |
def toeplitz?(matrix) | |
return false if square?(matrix) | |
matrix.each_with_index do |row, row_index| |
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 | |
if (! function_exists('asset_path')) { | |
/** | |
* Get the path to a versioned Mix file. | |
* | |
* @param string $path | |
* @param string $manifestDirectory | |
* @return \Illuminate\Support\HtmlString|string | |
* |
NewerOlder