Skip to content

Instantly share code, notes, and snippets.

View haze83's full-sized avatar

Marcel Imper haze83

View GitHub Profile
-- https://decodeunicode.org/en/u+2028
SELECT *
FROM wp_postmeta
WHERE post_id = 3646;
SELECT *
FROM wp_postmeta
WHERE post_id IN (
@haze83
haze83 / wp-cli-search-replace.sh
Last active February 1, 2024 07:13
WP Search Replace domain
wp search-replace old.domain.ch new.domain.ch --recurse-objects --all-tables --skip-plugins --skip-themes
@haze83
haze83 / .aliases
Last active February 12, 2024 10:31
Install Hosting
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"
@haze83
haze83 / F4BackgroundRequest.php
Last active November 3, 2023 22:40
WP Background Process
<?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' ) ) {
@haze83
haze83 / debug-wp-rewrite.php
Last active October 19, 2023 01:10
WP/WC Hooks
<?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>';
@haze83
haze83 / f4t_wc_email_cc_shipping.php
Last active October 19, 2023 01:25
F4 Shipping Phone and E-Mail for WooCommerce
<?
/**
* 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
*
@haze83
haze83 / create-config.sh
Last active February 12, 2024 10:54
WP-CLI
#!/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
@haze83
haze83 / README.md
Last active February 27, 2024 23:15
CLI

CLI

Simple cli shell scripts for daily use

Network tools like dig, ping, myip.

@haze83
haze83 / indesign-tracking-2-letter-spacing.scss
Created February 15, 2018 17:11
convert indesign tracking value to the css letter-spacing equivalent
// 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);
}
@haze83
haze83 / README.md
Last active October 19, 2023 01:37
PHP

PHP

Simple PHP scripts for daily use