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
# Requirements | |
# pip3 install fitz | |
# pip3 install xlsxwriter | |
# pip3 install urllib | |
# | |
# Run the script | |
# python3 extract-links.py | |
import fitz # PyMuPDF | |
import urllib.parse |
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 | |
define( 'HSPH_PLUGIN_ASSETS_PATH', plugin_dir_path( __FILE__ ) . 'assets/' ); | |
/** | |
* Saving ACF fields to assets folder. | |
* | |
* @return String The path where to save ACF json fields. | |
*/ | |
add_filter( |
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
{ | |
"name": "", | |
"description": "", | |
"type": "project", | |
"repositories": [ | |
{ | |
"type": "composer", | |
"url": "https://wpackagist.org" | |
} | |
], |
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 | |
// To run it, place into web root and then `wp eval-file stats.php > ~/stats.csv` | |
global $wpdb; | |
$sites = $wpdb->get_results( "SELECT blog_id,domain,path,last_updated FROM {$wpdb->prefix}blogs",'ARRAY_A' ); | |
foreach( $sites as &$site){ | |
if($site['blog_id'] === '1'){ | |
$post_table = $wpdb->prefix . 'posts'; | |
} else { | |
$post_table = $wpdb->prefix . absint($site['blog_id']) . '_posts'; | |
} |
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_filter( 'hsph_plugin_tagging_topics_post_types', 'cchange_register_cpt_for_tagging' ); | |
add_filter( 'hsph_plugin_tagging_cchange_issues_post_types', 'cchange_register_cpt_for_tagging' ); | |
add_filter( 'hsph_plugin_tagging_cchange_subtopics_post_types', 'cchange_register_cpt_for_tagging' ); | |
function cchange_register_cpt_for_tagging( $post_types = array() ) { | |
// Array of custom post types. | |
$cutom_post_types = array( 'cchange_article', 'cchange_issue', 'cchange_subtopic', 'cchange_bio', 'cchange_class', 'cchange_event' ); | |
// Merging default post types and custom post types. | |
$post_types = array_merge( $post_types, $cutom_post_types ); |
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
vagrant up | |
Bringing machine 'homestead-7' up with 'virtualbox' provider... | |
==> homestead-7: Importing base box 'laravel/homestead'... | |
==> homestead-7: Matching MAC address for NAT networking... | |
==> homestead-7: Checking if box 'laravel/homestead' version '7.0.0' is up to date... | |
==> homestead-7: Setting the name of the VM: homestead-7 | |
==> homestead-7: Clearing any previously set network interfaces... | |
==> homestead-7: Preparing network interfaces based on configuration... | |
homestead-7: Adapter 1: nat | |
homestead-7: Adapter 2: hostonly |
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
homestead $ vagrant destroy | |
==> homestead-7: Running triggers before destroy ... | |
==> homestead-7: Running trigger... | |
==> homestead-7: Backing up mysql database socket_wrench... | |
homestead-7: Running: inline script | |
==> homestead-7: Running trigger... | |
==> homestead-7: Backing up postgres database socket_wrench... | |
homestead-7: Running: inline script | |
==> homestead-7: Running trigger... | |
==> homestead-7: Backing up mysql database labpoint... |
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
# Install linux update, followed by GCC and Make | |
sudo yum -y update | |
# Install Nginx and PHP-FPM | |
sudo yum install -y nginx php-fpm | |
# Install PHP extensions | |
sudo yum install -y php-mysql php-pdo \ | |
php-mbstring php-cli \ | |
php-imap php-gd php-xml php-openssl php-tokenizer |
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
# Network wide search and replace | |
wp search-replace 'NEEDLE' 'HAYSTACK' --network --verbose | |
# Network wide search and replace for domain (ie: prod to dev DB migration) | |
wp search-replace 'old.domain.com' 'new.domain.com' --network --verbose --url=old.domain.com | |
# Network wide rewrite rules and permalinks flush | |
wp site list --field=url | xargs -n1 -I % wp rewrite flush --url=% |
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 | |
#Update this with your own path. Mine is in dropbox because I use Tom McFarlin's trick to sync https://tommcfarlin.com/sharing-visual-studio-code-settings/ | |
CODE_PREFS_PATH='/Users/guillaumemolter/Dropbox/Apps/Code/User/extensions.conf' | |
EXTENSIONS=`cat $CODE_PREFS_PATH` | |
for EXTENSION in ${EXTENSIONS[@]} | |
do | |
code --install-extension $EXTENSION | |
done | |
# then add to your .bash_profile : |
NewerOlder