For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
[Unit] | |
Description=Keeps a tunnel to 'remote.example.com' open | |
After=network.target | |
[Service] | |
User=autossh | |
# -p [PORT] | |
# -l [user] | |
# -M 0 --> no monitoring | |
# -N Just open the connection and do nothing (not interactive) |
#!/usr/bin/env perl | |
#============================================================================= | |
# | |
# FILE: dmarc-report-display.pl | |
# | |
# USAGE: ./dmarc-report-display.pl REPORT | |
# | |
# DESCRIPTION: Parse and display a DMARC report | |
# | |
# REQUIREMENTS: Perl 5.10; File::LibMagic, Term::ANSIColor; XML::LibXML |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/** | |
* A function to reorder the default display of fields on the WooCommerce Bookings form | |
* Put this function in your theme's functions.php file | |
*/ | |
function custom_order_booking_fields ( $fields ) { | |
$reorder = array(); | |
$reorder[] = $fields['wc_bookings_field_duration']; // Duration | |
$reorder[] = $fields['wc_bookings_field_resource']; // Resource | |
$reorder[] = $fields['wc_bookings_field_persons']; // Persons |
Redis::connection()->del('queues:myqueue'); |
#!/bin/bash | |
adb=your/android/sdk/path/platform-tools/adb | |
folder=. | |
$adb shell am broadcast -a com.android.systemui.demo --es command enter | |
$adb shell am broadcast -a com.android.systemui.demo --es command clock --es hhmm 0520 | |
$adb shell am broadcast -a com.android.systemui.demo --es command battery --es level 100 --es plugged false | |
$adb shell am broadcast -a com.android.systemui.demo --es command network \ | |
--es mobile show \ | |
--es fully true \ |