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 APIController | |
{ | |
uses SunsetsEndpoints; | |
public function index() | |
{ | |
return $this->sunsetResponse($apiResponse, 'really cool date here'); | |
} |
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 | |
$stack = new \GuzzleHttp\HandlerStack(\GuzzleHttp\choose_handler()); | |
$stack->push(function (callable $handler) { | |
return function ( | |
\Psr\Http\Message\RequestInterface $request, | |
array $options | |
) use ($handler) { | |
$promise = $handler($request, $options); |
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 | |
tap(null, function (&$email) { | |
preg_match('/\@(.*)\./', $email, $matches); | |
$email = $matches[1]; | |
}) |
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\Modules\Foo\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider { | |
protected $defer = true; | |
public function register() { | |
$this->app->bind(FooThingInterface::class, FooThing::class); | |
} |
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 | |
/** | |
* Returns a random item from the collection based on a weighted value. | |
* ['foo' => 70, 'bar' => 30] Foo has a 70 percent chance of being returned | |
* @return int|string | |
*/ | |
Collection::macro('weightedRandom', function () { | |
$sumOfWeights = $this->sum(); | |
$rand = rand(1, $sumOfWeights); |
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
Verifying that +hskrasek is my blockchain ID. https://onename.com/hskrasek |
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 | |
use Config; | |
use Illuminate\Support\Contracts\ArrayableInterface; | |
class Board implements ArrayableInterface | |
{ | |
/** | |
* Easy Difficulty | |
* |
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
import json | |
from pprint import pprint | |
from os.path import expanduser | |
import os | |
home = expanduser("~") | |
baseDir = home + '/Documents/Projects/iodocs/public/data' | |
for subdir, dirs, files in os.walk(baseDir): | |
for file in files: | |
# if file == 'apiconfig.json' or file.startswith('.'): |
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
#Thanks StackOverflow: http://stackoverflow.com/a/91795 | |
git log --graph --oneline --decorate $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) | |
git stash apply $stash_id |
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
@extends('layout') | |
@section('content') | |
<h1>Create a new task...</h1> | |
<ul> | |
@foreach($errors->all() as $error) | |
<li>{{$error}}</li> | |
@endforeach | |
</ul> |
NewerOlder