Skip to content

Instantly share code, notes, and snippets.

View vitaliikaplia's full-sized avatar
🇺🇦

Vitalii Kaplia vitaliikaplia

🇺🇦
View GitHub Profile
@tleish
tleish / mysql_backup.sh
Last active April 24, 2024 13:00
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active April 24, 2024 10:11
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@jessuppi
jessuppi / gist:d6ae9421a690c79dc6bb04d0847b5997
Created August 18, 2020 19:27
WP Engine wp-config.php example
<?php
# Database Configuration
define( 'DB_NAME', 'XXX' );
define( 'DB_USER', 'XXX' );
define( 'DB_PASSWORD', 'XXX' );
define( 'DB_HOST', '127.0.0.1' );
define( 'DB_HOST_SLAVE', '127.0.0.1' );
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_unicode_ci');
$table_prefix = 'wp_';
@chrismccoy
chrismccoy / gutenberg.txt
Last active April 4, 2024 20:34
Gutenberg Resources
How to parse Gutenberg content for headless WordPress
https://kinsta.com/blog/headless-wordpress-gutenberg/
Adding wrapper to Gutenberg’s Table block
https://helloadmin.com/adding-wrapper-to-gutenbergs-table-block/
Display specific Gutenberg blocks of a post outside of the post content in the theme
https://florianbrinkmann.com/en/display-specific-gutenberg-blocks-of-a-post-outside-of-the-post-content-in-the-theme-5620/
Modifying the Markup of a Core Block
@taotiwordpress
taotiwordpress / twig-bag-of-tools.md
Last active February 14, 2024 16:31
Twig Cheatsheet #twig #timber #wordpress #cheatsheet #images #wp-query #wp_query #the_loop

Timber Bag of Tools Cheat Sheet

Useful Variables

Remember, there are 'TWIG' tools and then there are 'Timber' tools.

The second is WordPress specific.

Twig-based Variables

@treetop1500
treetop1500 / _meta.html.twig
Last active December 22, 2023 08:12
Twig template for meta tags, titles and other head element meta data.
{#
Relies mostly on a meta array containing appropriate values.
site_name is a parameter set as a Twig Global
default_share_image is a fallback parameter set as a Twig Global
#}
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="index, follow" />
<meta property="og:type" content="website" />
@amboutwe
amboutwe / yoast_seo_title_change-variable.php
Last active May 23, 2022 17:09
Change existing or add custom title or meta template variables
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Change existing title or meta template variable
* Credit: Moshe Harush
* https://stackoverflow.com/questions/36281915/yoast-seo-how-to-create-custom-variables
* Last Tested: Unknown
*/
// define the wpseo_replacements callback
function filter_wpseo_replacements( $replacements ) {
@TyounanMOTI
TyounanMOTI / esed
Created February 17, 2011 17:05
'sed -e' for each file. Output result for each file.
#!/bin/bash
# esed 's/foo/bar/g' files....
script=$1
shift 1
CHANGED=1 # diff returns 1 for differences. (0 for no difference, 2 for errors.)
for file in $*
do
sed -e ${script} ${file} > ${file}~
diff ${file} ${file}~ > /dev/null
@AprendendoLinux
AprendendoLinux / restore.sh
Last active October 30, 2020 08:37
MySQL Restore
#!/bin/bash
###################################################
## CREDENCIAIS DO MYSQL NO ARQUIVO /root/.my.cnf ##
## ##
## [mysql] ##
## user=root ##
## password='M!nh@S3nh@' ##
## host='ip-ou-dns-do-servidor' ##
## ##