Simple cli shell scripts for daily use
Network tools like dig, ping, myip.
-- https://decodeunicode.org/en/u+2028 | |
SELECT * | |
FROM wp_postmeta | |
WHERE post_id = 3646; | |
SELECT * | |
FROM wp_postmeta | |
WHERE post_id IN ( |
wp search-replace old.domain.ch new.domain.ch --recurse-objects --all-tables --skip-plugins --skip-themes |
alias l='ls -l' | |
alias la='ls -la' | |
alias lt='ls --tree' | |
alias ll="ls -lhAF" | |
alias wp="wp-cli" | |
alias myip="curl http://ipecho.net/plain; echo" |
<?php | |
/** | |
* F4 Background Process | |
* | |
* Based on WP_Background_Process | |
* https://github.com/A5hleyRich/wp-background-processing/blob/master/classes/wp-background-process.php | |
*/ | |
if ( ! class_exists( 'F4_Background_Process' ) ) { |
<?php | |
function debug_wp_rewrite_dump(&$wp) { | |
echo '<pre>'; | |
global $wp_rewrite; | |
echo '<h2>rewrite rules</h2>'; | |
echo var_export($wp_rewrite->wp_rewrite_rules(), true); | |
echo '<h2>permalink structure</h2>'; |
<? | |
/** | |
* Adds shipping email address as cc to WoocCmmerce customer emails | |
* | |
* @param string $header WC_Email header | |
* @param string $id WC_Email id | |
* @param \WC_Order $object | |
* @return string | |
* |
#!/bin/bash | |
# bash -c "$(curl -s https://gist.githubusercontent.com/haze83/0a8c65479b793285e00e92f561e66f8d/raw/d2537e8e3db767a9eb0954446e6bde571f107dc1/create-config.sh)" | |
echo "WP user: " | |
read WP_USER | |
echo "PROD (no leading /, relative to $HOME): " | |
read WP_PATH_PROD | |
echo "STAGING (no leading /, relative to $HOME): " | |
read WP_PATH_STAGING |
// convert indesign tracking value to css letter-spacing | |
@function tracking-to-letter-spacing($tracking: 0) { | |
@return $tracking / 1000 * 1em; | |
} | |
@mixin tracking-to-letter-spacing($tracking: 0) { | |
letter-spacing: tracking-to-letter-spacing($tracking); | |
} |