// Single parameter
route('users/{id}', 1);
// Array of parameters
route('users/{user_id}/docs/{doc_id}', [1, 548]);
// Parameter object
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
esphome: | |
name: "esp-ashp" | |
on_boot: | |
priority: -100 | |
then: | |
- lambda: |- | |
esphome::modbus_controller::ModbusController *controller = id(ashp_modbus); | |
std::vector<uint16_t> outdoor_registers = { | |
0x8238, // Compressor frequency | |
0x8204, // Outdoor temperature |
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
function dbbackup() { | |
if [[ "$1" ]] | |
then | |
BACKUP_DIR="$1" | |
MYSQL_USER="[USERNAME]" | |
MYSQL_PASSWORD="[PASSWORD]" | |
TIMESTAMP=$(date +"%F") | |
MYSQL=/usr/bin/mysql | |
MYSQLDUMP=/usr/bin/mysqldump |
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
#!/bin/bash | |
HOSTSFILE="/etc/hosts" | |
BAKFILE="$HOSTSFILE.bak" | |
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$" | |
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" | |
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$" | |
PARAMETERS="$@" | |
backup() |
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
#!/usr/bin/env bash | |
worker="[program:worker-"$2"] | |
command=php "$1"artisan queue:listen --sleep=10 --quiet --tries=3 --queue=default | |
autostart=true | |
autorestart=true | |
user=vagrant | |
redirect_stderr=true | |
stdout_logfile=/home/vagrant/.workers/worker-"$2".log | |
" |
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
#!/usr/bin/env bash | |
echo ">>> Installing MongoDB" | |
mongod --version > /dev/null 2>&1 | |
MONGO_IS_INSTALLED=$? | |
if [ $MONGO_IS_INSTALLED -eq 0 ]; then | |
echo ">>> MongoDB already installed" | |
service mongod restart |
PM2's startup
service script is triggered before Vagrant mounts the local directories so none of the scripts it's tasked with starting can be found.
Use Upstart's events to trigger pm2 resurrect
once local directories have been mounted.
Notice: At the time of writing, Vagrant's vagrant-mounted
event is not being triggered on Ubuntu < 15.04. To fix this, you should add the following workaround:
Create a file called /etc/init/workaround-vagrant-bug-6074.conf
with the following content:
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\Http\Middleware; | |
use Closure; | |
class VerifyShopifyWebhook | |
{ | |
/** | |
* Handle an incoming request. |
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
{ | |
"keys": ["super+i"], | |
"command": "run_macro_file", | |
"args": {"file": "Packages/User/Macros/initialize_properties.sublime-macro"}, | |
"context": [{"key": "selector", "operator": "equal", "operand": "source.php"}] | |
} |