Skip to content

Instantly share code, notes, and snippets.

View NoahBohme's full-sized avatar
🧙‍♂️
bugfixing

Noah Böhme Rasmussen NoahBohme

🧙‍♂️
bugfixing
View GitHub Profile
@NoahBohme
NoahBohme / get_wordpress_db.sh
Created November 10, 2023 08:43
Get the database of mysql from local host
#!/bin/bash
# Define the path to your WordPress wp-config.php file
wp_config="./wp-config.php"
# Extract database credentials from wp-config.php
db_name=$(grep -oP "DB_NAME\s*=\s*'(\K[^']+)" "$wp_config")
db_user=$(grep -oP "DB_USER\s*=\s*'(\K[^']+)" "$wp_config")
db_password=$(grep -oP "DB_PASSWORD\s*=\s*'(\K[^']+)" "$wp_config")
db_host=$(grep -oP "DB_HOST\s*=\s*'(\K[^']+)" "$wp_config")
@NoahBohme
NoahBohme / wordpress-post-api.py
Created September 27, 2023 07:35
Create a POST with the WordPress API using Python
import requests
from requests.auth import HTTPBasicAuth
# Replace with your WordPress site URL
wordpress_url = 'https://website/wp-json/wp/v2/posts'
# Replace with your username and password
username = 'user'
password = 'lXsJ J1jB R43j MaBq lkzP x5Hr'
@NoahBohme
NoahBohme / remove-3-month-woo-wp.php
Created June 23, 2023 15:50
Script that removes products which have not been updated more than 3 months - Woocommerce
<?php
// Define the WooCommerce product age threshold in months
$thresholdMonths = 3;
// Get current date and time
$currentDate = new DateTime();
// Setup WooCommerce query arguments
$args = array(
'post_type' => 'product',
//Elementor PRO
/jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js
/jquery-migrate(.min)?.js
/elementor/
/elementor-pro/
/wp-includes/js/imagesloaded.min.js
ElementorProFrontendConfig
elementorFrontendConfig
// Resolve User Cache
@NoahBohme
NoahBohme / gist:a08060a692e9839f28b55a23e174450c
Created September 2, 2021 19:37 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@NoahBohme
NoahBohme / HSTS i .htaccess
Created May 14, 2021 19:16
HSTS i .htaccess
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS

Keybase proof

I hereby claim:

  • I am noahbohme on github.
  • I am noahbohme (https://keybase.io/noahbohme) on keybase.
  • I have a public key ASDoJGAUGgXPwnipuKtyeQfFHP6oLkIJnLfhRXrOguxmGAo

To claim this, I am signing this object: