Skip to content

Instantly share code, notes, and snippets.

View rodsotdia's full-sized avatar
📸
Making broken shots.

Rod Sot rodsotdia

📸
Making broken shots.
View GitHub Profile
@rodsotdia
rodsotdia / code.md
Last active April 29, 2024 20:24
Cursor symlink fix

Go to C:\Users\username\AppData\Local\Programs\cursor\resources\app\bin\cursor

Edit the following variables:

VSCODE_PATH="$(dirname "$0")/.."

VSCODE_PATH="$(dirname "$(readlink -f "$0")")/.."

ELECTRON="$VSCODE_PATH/cursor"
@rodsotdia
rodsotdia / emoji_terminal.md
Created April 11, 2023 05:49
Emojis that works in terminal
Emoji Name Text example
🚀 Rocket You're up
📦 Package Installing additional dependencies...
Hook Running completion hooks...
📄 Document Generating README.md...
🎉 Party Successfully created project hello-vue.
👉 Next Get started with the following commands:
Tick Task completed
Magic Assembling project...
@rodsotdia
rodsotdia / remove_filters_hooks.php
Created January 30, 2023 01:16
Remove hooks from plugins without access to the class object
/* ------------------------------
REMOVE HOOKS WITHOUT CLASS OBJECT ACCESS
Reference: https://gist.github.com/tripflex/c6518efc1753cf2392559866b4bd1a53#gistcomment-3528826
Reference: https://github.com/herewithme/wp-filters-extras/blob/master/wp-filters-extras.php
---------------------------------- */
function remove_class_hook($tag, $class_name = '', $method_name = '', $priority = 10)
{
global $wp_filter;
$is_hook_removed = false;
if (!empty($wp_filter[$tag]->callbacks[$priority])) {
@rodsotdia
rodsotdia / woo-events.js
Created November 24, 2022 23:30 — forked from bagerathan/woo-events.js
[Woocommerce Javascript events] #woo
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
@rodsotdia
rodsotdia / updateNpm.bat
Last active July 13, 2022 00:27 — forked from nokidding/updateNpm.bat
Windows batch file which updates npm for nvm-windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@rodsotdia
rodsotdia / simple_curl.php
Created September 28, 2021 21:13 — forked from ViliamKopecky/simple_curl.php
Simple cURL wrapper function for GET, POST, PUT & DELETE methods
/**
* Wrapper for easy cURLing
*
* @author Viliam Kopecký
*
* @param string HTTP method (GET|POST|PUT|DELETE)
* @param string URI
* @param mixed content for POST and PUT methods
* @param array headers
* @param array curl options
@rodsotdia
rodsotdia / get_instagram_media.php
Created September 23, 2021 02:10 — forked from gsarig/get_instagram_media.php
Get Instagram media on WordPress using the current Instagram (Facebook) API (details: https://www.gsarigiannidis.gr/instagram-feed-api-after-june-2020/)
<?php
/**
* Get Instagram media on WordPress using the current Instagram (Facebook) API
*
* @param $token // Info on how to retrieve the token: https://www.gsarigiannidis.gr/instagram-feed-api-after-june-2020/
* @param $user // User ID can be found using the Facebook debug tool: https://developers.facebook.com/tools/debug/accesstoken/
* @param int $limit // Add a limit to prevent excessive calls.
* @param string $fields // More options here: https://developers.facebook.com/docs/instagram-basic-display-api/reference/media
* @param array $restrict // Available options: IMAGE, VIDEO, CAROUSEL_ALBUM
*
[
{
"featureType": "all",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#ffffff"
}
]
},
@rodsotdia
rodsotdia / functions.php
Created April 27, 2021 20:40 — forked from tripflex/functions.php
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* Make sure the function does not exist before defining it
*/
if( ! function_exists( 'remove_class_filter' ) ){
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
@rodsotdia
rodsotdia / smtp.php
Created April 14, 2021 04:43
SMTP Config WordPress
// Configures WordPress to use SMTP server in wp-config.php
define( 'SMTP_USER', '[email protected]' ); // Username to use for SMTP authentication
define( 'SMTP_PASS', 'SMTP_PASSWORD' ); // Password to use for SMTP authentication
define( 'SMTP_HOST', 'smtp.smtpserver.com' ); // The hostname of the mail server
define( 'SMTP_FROM', '[email protected]' ); // SMTP From email address
define( 'SMTP_NAME', 'FROM_NAME' ); // SMTP From name
define( 'SMTP_PORT', '25' ); // SMTP port number - likely to be 25, 465 or 587
define( 'SMTP_SECURE', 'tls' ); // Encryption system to use - ssl or tls
define( 'SMTP_AUTH', true ); // Use SMTP authentication (true|false)
define( 'SMTP_DEBUG', 0 ); // for debugging purposes only set to 1 or 2