Skip to content

Instantly share code, notes, and snippets.

Avatar

Liam Hammett imliam

View GitHub Profile
@judy2k
judy2k / parse_dotenv.bash
Created Mar 22, 2017
Parse a .env (dotenv) file directly using BASH
View parse_dotenv.bash
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@calebporzio
calebporzio / tinker_helper.php
Created Jan 30, 2019
A quick, memorable way to initiate an "artisan tinker" session and play with variables.
View tinker_helper.php
<?php
function tinker(...$args) {
// Because there is no way of knowing what variable names
// the caller of this function used with the php run-time,
// we have to get clever. My solution is to peek at the
// stack trace, open up the file that called "tinker()"
// and parse out any variable names, so I can load
// them in the tinker shell and preserve their names.
@Cannonb4ll
Cannonb4ll / Discord.php
Created Oct 13, 2019
Laravel Discord Notification Channel
View Discord.php
<?php
namespace App\Utilities\Discord;
use Exception;
use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Exception\RequestException;
use App\Exceptions\CouldNotSendNotification;
class Discord
You can’t perform that action at this time.