Skip to content

Instantly share code, notes, and snippets.

@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active January 11, 2024 20:48
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/
@blacksaildivision
blacksaildivision / httpd.service
Created November 12, 2016 14:39
SystemD (systemctl) script for managing Apache httpd compiled from source
[Unit]
Description=The Apache HTTP Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/apache2/bin/apachectl -k start
ExecReload=/usr/local/apache2/bin/apachectl -k graceful
ExecStop=/usr/local/apache2/bin/apachectl -k graceful-stop
PIDFile=/usr/local/apache2/logs/httpd.pid
@wavezhang
wavezhang / java_download.sh
Last active April 29, 2024 14:42
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@HarmJ0y
HarmJ0y / Restore-UserDPAPI.ps1
Last active July 7, 2023 09:05
Restore a user's stolen DPAPI master key folder and optional KeePass DPAPI data blob.
function Restore-UserDPAPI {
<#
.SYNOPSIS
Restores a user account's DPAPI master key on a new system.
Author: @harmj0y
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None

Install multiple PHP instances on Linux

Install prerequisites for building PHP

Install the packages needed to build packages

apt-get install build-essential

Install PHP build dependencies

anonymous
anonymous / config.json
Created March 1, 2015 12:00
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@tw3eX
tw3eX / update wp
Created January 22, 2014 02:56
update wp
UPDATE wp_options SET option_value = replace(option_value, 'http://wp', 'http://pushkarev-adv.ru') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://wp','http://pushkarev-adv.ru');
UPDATE wp_posts SET post_content = replace(post_content, 'http://wp', 'http://pushkarev-adv.ru');
@deltafactory
deltafactory / fix-nextgen-lightbox-path.php
Created October 2, 2013 04:57
Fix stored URLs for Lightbox assets in NextGEN Gallery 2.x. If you find that your lightbox images are missing or are pointing to the old location for the site, then this script will help.
<?php
/*
INSTRUCTIONS:
Use at your own risk. Backup your database before continuing.
1. Copy code to a file in the root of your website.
2. Change YOUR_SITE_ROOT to a value that makes sense.
3. Execute by visiting the page. Verify before/after results.
4. Change MAKE_CHANGES_TO_SITE to true and execute it again.
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@mgirouard
mgirouard / destroy-sample-data.php
Created October 1, 2010 02:02
A quick hack to destroy all sample data in an OpenCart catalog.
<?php
$options = getopt('p:');
$prefix = empty($options['p'])
? realpath('.')
: realpath($options['p']);
if (empty($prefix)) {
die("Bad prefix. Try again.\n");
}