- Python 3
- Selenium
python app.py
<?php | |
class APIController | |
{ | |
uses SunsetsEndpoints; | |
public function index() | |
{ | |
return $this->sunsetResponse($apiResponse, 'really cool date here'); | |
} |
<?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); |
<?php | |
tap(null, function (&$email) { | |
preg_match('/\@(.*)\./', $email, $matches); | |
$email = $matches[1]; | |
}) |
<?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); | |
} |
<?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); |
Verifying that +hskrasek is my blockchain ID. https://onename.com/hskrasek |
<?php | |
use Config; | |
use Illuminate\Support\Contracts\ArrayableInterface; | |
class Board implements ArrayableInterface | |
{ | |
/** | |
* Easy Difficulty | |
* |
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('.'): |
#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 |