Skip to content

Instantly share code, notes, and snippets.

@Mediatros
Mediatros / blog.py
Created July 7, 2022 10:29 — forked from skolo-online/blog.py
AI Blog Generator Tool
import os
import openai
import config
openai.api_key = config.OPENAI_API_KEY
def generateBlogTopics(prompt1):
response = openai.Completion.create(
@Mediatros
Mediatros / 00-wordpress-debug.php
Created August 3, 2021 20:18 — forked from CapWebSolutions/00-wordpress-debug.php
[WordPress] Tools For WordPress Projects
<?php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 1 );
define( 'SCRIPT_DEBUG', true );
define( 'SAVEQUERIES', true );
@Mediatros
Mediatros / fullyear.js
Created August 3, 2021 20:17 — forked from CapWebSolutions/fullyear.js
Write out curent year in HTML page
<script>document.write( new Date().getFullYear() );</script>
@Mediatros
Mediatros / gist:a166052792c42611a5fd9a9ecb20f2a2
Created August 3, 2021 20:15 — forked from CapWebSolutions/gist:71470cf053a2f1cb37534d49793d4426
Create copyright shortcode for use in footer
/*
* Usage
* Use [year] in your posts.
*/
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
@Mediatros
Mediatros / add-column.php
Created August 3, 2021 20:12 — forked from CapWebSolutions/add-column.php
Add column to MainWP sites screen to display Last Security Scan date
<?php
/**
* Create Custom Column in the Manage Sites table for Last Secirty Scan date
* ref: https://meta.mainwp.com/t/solved-add-second-field-to-dashboard/3015
* ref: https://meta.mainwp.com/t/display-group-s-column-in-the-manage-sites-table/2932
* ref: https://meta.mainwp.com/t/create-custom-column-in-the-manage-sites-table-with-data-from-client-data/2877
*/
add_filter( 'mainwp_sitestable_getcolumns', 'mycustom_mainwp_sitestable_getcolumns', 10, 1 );
@Mediatros
Mediatros / sec-scan-v5.sh
Last active January 26, 2021 10:16 — forked from CapWebSolutions/sec-scan-v5.sh
Perform MainWP Security scan on all configured sites from terminal
#
# Ce script est exécuté à partir d'une invite de terminal à la racine de votre site web MainWP WordPress
#
# Exécuter la commande MainWP CLI pour générer une liste de tous les sites configurés dans MainWP
# Faire passer la sortie à travers le filtre pour éliminer les colonnes 3 et 4 de la sortie. Ces colonnes contiennent le numéro de site à 2 chiffres. Ajuster si plus de 99 sites.
# Passez cette sortie pour éliminer les lignes de commentaires dans la liste des sites.
# Passez cette sortie dans l'éditeur SED en insérant la commande de scan de sécurité au début de la ligne
# Envoyer le tout dans un script shell pour être exécuté.
wp mainwp sites | cut -c3-4 | grep -E '([0-9]|[0-9][0-9])' | sed 's/^/wp mainwp-sucuri scan /' > sec-scan-auto.sh
#
@Mediatros
Mediatros / ScreenAnalysis.py
Created January 18, 2021 12:41 — forked from rinchik/ScreenAnalysis.py
Analyzing and finding differences between 2 screenshots captured with Selenium in Python
from PIL import Image, ImageDraw
from selenium import webdriver
import os
import sys
class ScreenAnalysis:
STAGING_URL = 'http://www.yahoo.com'
PRODUCTION_URL = 'http://www.yahoo.com'
driver = None
@Mediatros
Mediatros / mainwp-client-report-monthly.html
Created January 13, 2021 08:32 — forked from uamv/mainwp-client-report-monthly.html
HTML Text Used for MainWP Monthly Client Report
<table style="width: 600px; margin: 0 auto; padding: 0; border-spacing: 0; border-collapse: collapse;"><tbody><tr><td style="background: #040404; margin-top: 0; padding: 0;"><img style="display: block; border: 0; line-height: 1;" src="https://typewheel.xyz/share/typewheel-email-banner.png" alt="Typewheel" width="600" /></td></tr><tr><td style="padding: 2em; background-image: linear-gradient( to bottom, #D7D7D7, #E7D3BA);"><p style="margin: 0 2em 2em;">Hello [client.contact.nickname]! Here's an overview of the things I am doing to keep your site updated, optimized, and secure.</p><p style="text-align: center; margin: 0 0 1.5em;"><img style="display: block; margin: 0 auto .5em;" src="[client.logo.url]" alt="[client.name] Logo" height="100" /><span style="text-align: center; font-size: 28px;"><strong>[report.daterange]</strong></span><br /><span style="text-align: center; font-size: 28px;"><strong><a style="color: #040404; text-decoration: none;" href="[client.site.url]">[client.site.domain]</a></strong></span><
@Mediatros
Mediatros / site-sucker.sh
Created January 6, 2021 16:05 — forked from heyalexej/site-sucker.sh
Helps you to download a WordPress (and other sites) from the command line and reuse as static HTML.
wget --html-extension --recursive --page-requisites --convert-links --mirror --user-agent="Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)" http://www.yourdomain.com
@Mediatros
Mediatros / Activate Office 2019 for macOS VoL.md
Created November 30, 2020 15:20 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref