Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
## | |
# "I did [mean that]" | |
# Re-run the suggested git command | |
# Intended to be run as 'idid "!!"' | |
# Place this file in your $PATH | |
# TODO create this as a brew script | |
## | |
declare last='' | |
declare selection_ordinal='1' |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
<?php | |
namespace App\Http\Controllers\Auth; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
use GuzzleHttp\Client; |
#!/usr/bin/php | |
<?php | |
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"'); | |
$files = explode("\n", trim($files)); | |
$exitCode = 0; | |
foreach ($files as $file) { | |
if (empty($file)) { |
Options included below:
docker-compose
brew
This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew
any longer. Instead consider adding a barebones docker-compose.yml
for each project and run docker-compose up
to start each project's mysql service.
#!/usr/bin/env bash | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
In EcmaScript 2015 (ES6) the expression (x) => x * 2
means to create an anonymous function with one parameter x
that will return x * 2
. For example:
(x) => x * 2
// is equivalent to:
function(x) { return x * 2; }
A modified example from [documentation by Mozilla Developer Network][1] page demonstrates how they are useful:
var a = [
"Hydrogen",
<?php | |
namespace %namespace%; | |
use PhpSpec\ObjectBehavior; | |
use Prophecy\Argument; | |
class %name% extends ObjectBehavior | |
{ | |
function it_is_initializable() |
<input type="text" | |
name="home_phone" | |
class="form-control" | |
v-model="homePhone | phone" | |
lazy> |
<?php | |
/** | |
* Send a Message to a Slack Channel. | |
* | |
* In order to get the API Token visit: | |
* | |
* 1.) Create an APP -> https://api.slack.com/apps/ | |
* 2.) See menu entry "Install App" | |
* 3.) Use the "Bot User OAuth Token" |