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 | |
add_action('init', function () { | |
$user = 'Bootpack'; | |
$pass = '{{someRandomPassword}}'; | |
$email = 'dev@bootpackdigital.com'; | |
if (!username_exists($user) && !email_exists($email)) { | |
$user_id = wp_create_user($user, $pass, $email); | |
$user = new WP_User($user_id); | |
$user->set_role('administrator'); | |
} |
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
// Postition sticky won't work if any of that elements ancestors have overflow hidden, auto, or scroll | |
let parent = document.querySelector('.sticky').parentElement; | |
while (parent) { | |
const hasOverflow = getComputedStyle(parent).overflow; | |
if (hasOverflow !== 'visible') { | |
console.log(hasOverflow, parent); | |
} | |
parent = parent.parentElement; |
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
echo "GET https://example.com" | vegeta attack -rate 50 | tee results.bin | vegeta report | |
watch "cat results.bin | vegeta report" |
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 | |
# Instructions | |
## Save this file to the root of where your projects are stored | |
## cd to the projects root directory and run chmod +x _timelog.sh | |
## Change Michael Bonner to your name as it's set in your git config | |
# | |
AUTHOR="Michael Bonner" | |
TWO_MONTHS_AGO=`date -j -v-2m` |
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
# Legend: | |
## {USER_NAME} replace with the user you log in to the system as | |
## {APPLICATION_DIRECTORY} : replace with the project directory name | |
# Installing bindfs (just the first time) | |
$ sudo apt-get update | |
$ sudo apt-get -y install bindfs | |
# Creating the application mount point | |
$ mkdir -p /home/{USER_NAME}/sites/{APPLICATION_DIRECTORY} |
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
# Add the following to your wp-config.php file | |
# Replace http://example.com/ with your url | |
if (!defined('WP_SITEURL')) { | |
define('WP_SITEURL', 'http://example.com/'); | |
} | |
if (!defined('WP_HOME')) { | |
define('WP_HOME', 'http://example.com/'); | |
} |
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
SELECT TABLE_NAME, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024 ), 2 ) "MB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "schema_name" | |
ORDER BY (data_length + index_length) DESC; |
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
ab -n 1000 -c 5 http://www.example.com/ |
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
du -h / | sort -h |
NewerOlder