Skip to content

Instantly share code, notes, and snippets.

View beatwiz's full-sized avatar
🥶
#crunching

Gustavo Silva beatwiz

🥶
#crunching
View GitHub Profile
@beatwiz
beatwiz / my.cnf
Created August 13, 2024 10:48 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@beatwiz
beatwiz / opcache.ini
Created August 13, 2024 10:48 — forked from rohankhudedev/opcache.ini
Best Zend OpCache Settings / Tuning / Configurations
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=512
@beatwiz
beatwiz / functions.php
Created March 2, 2023 09:05
Block WP JSON API Get Users
<?php
/**
* Block Users JSON API
*/
add_filter('rest_endpoints', function ($endpoints) {
if (isset($endpoints['/wp/v2/users'])) {
unset($endpoints['/wp/v2/users']);
}
@beatwiz
beatwiz / shell.sh
Last active April 29, 2022 09:09
Convert movie files using ffmpeg on macos (mov to mp4) (dolby vision mkv to mp4 container for LG)
# convert mov to mp4
# https://medium.com/macoclock/convert-mov-to-mp4-on-a-mac-c9c93b730d84
brew install ffmpeg
ffmpeg -i demo.mov -vcodec h264 demo.mp4
# convert DoVi mkv to DoVi mp4
# will only convert first video and audio stream and will skip subtitles
# https://www.reddit.com/r/ffmpeg/comments/qe7oq1/comment/i45kbpy/?utm_source=share&utm_medium=web2x&context=3
ffmpeg -i input.mkv -c copy -strict unofficial output.mp4
@beatwiz
beatwiz / add-gtm-wp.php
Created August 10, 2021 10:55 — forked from jsn789/add-gtm-wp.php
Add Google Tag Manager through functions.php in WordPress
/* Add Google Tag Manager javascript code as close to
the opening <head> tag as possible
=====================================================*/
function add_gtm_head(){
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
@beatwiz
beatwiz / woocommerce-duplicate-skus.sql
Created July 21, 2021 08:17 — forked from yanknudtskov/woocommerce-duplicate-skus.sql
Select Duplicate SKUs from WooCommerce Database #woocommerce #mysql
SELECT meta_value
FROM wp_fanatic_shop_postmeta
WHERE meta_key = '_sku'
AND meta_value != ''
GROUP BY meta_value HAVING COUNT(meta_value) > 1
@beatwiz
beatwiz / acf-php-to-json.php
Last active April 29, 2021 05:37 — forked from ollietreend/acf-php-to-json.php
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
<?php
/**
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
*/
namespace ConvertAcfPhpToJson;
/**
* Add submenu item under 'Custom Fields'
@beatwiz
beatwiz / mouse_speed.sh
Created August 13, 2020 07:10 — forked from bmarkons/mouse_speed.sh
Boost mouse speed on iMac
# Stolen from here https://www.tylernichols.com/apple/speed-up-mouse-tracking-on-mac-os-x
defaults write -g com.apple.mouse.scaling 6.0
@beatwiz
beatwiz / creative-cloud-disable.md
Created August 13, 2020 07:02 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@beatwiz
beatwiz / readme.md
Last active September 4, 2019 21:14
Permanent Facebook Page Access Token

1) Create a new APP if needed

Default permissions, just need an APP id / APP secret

2) On the Facebook Graph API Explorer

https://developers.facebook.com/tools/explorer/

i) Choose the correct APP, and click on Get Token > Get User Access Token

ii) Copy the returned token