adduser {{username}}
#!/bin/bash | |
source ./.env | |
themes_path=./$dir_wp_content/themes | |
has_theme_subdirectories=`find $themes_path -maxdepth 1 -type d | wc -l` | |
[[ has_theme_subdirectories -eq 1 ]] && themes_installed=false || themes_installed=true |
fs.readFile( | |
'./config.json', | |
(err, data) => { | |
let json = JSON.parse(data); | |
json.externalURL = bs.utils.devIp.shift(); | |
fs.writeFile('./config.json', JSON.stringify(json), err => { | |
if (err) { | |
throw err; | |
} | |
}) |
<?php | |
array_reduce($arr, function ($result, $item) { | |
$result[$item->term_id] = $item->name; | |
return $result; | |
}, []); |
on write_to_file(this_data, target_file, append_data) | |
try | |
set the target_file to the target_file as string | |
set the open_target_file to open for access file target_file with write permission | |
if append_data is false then set eof of the open_target_file to 0 | |
write this_data to the open_target_file starting at eof | |
close access the open_target_file | |
return true | |
on error | |
try |
Search and replace | |
https://wp-cli.org/commands/search-replace/ | |
wp search-replace | |
wp search-replace 'http://example.dev' 'http://example.com' | |
Optmize database | |
https://wp-cli.org/commands/db/optimize/ | |
wp db optimize | |
Repair database |
TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl
extension and a different #!
call.
The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect
we use the following:
#!/usr/bin/expect
Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors
This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.
One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.
An alternative version of this design automatically invokes the base constructor in most situations.
This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This is accurate as of WordPress 4.8, and includes some upcoming changes in WordPress 4.9.
There are a few TODOs left. Please bear with me.
Edit: I few months ago I got a new laptop and did the same thing on Mavericks.
I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).
I kinda regret for not using Boxen to automate the