Skip to content

Instantly share code, notes, and snippets.

View fearlex's full-sized avatar
🎯
Focused

Arleys Resco fearlex

🎯
Focused
View GitHub Profile
@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@helgatheviking
helgatheviking / add-taxonomy-to-woocommerce-export.php
Last active March 4, 2024 14:51
Add a custom taxonomy to WooCommerce import/export
<?php
/*
* Plugin Name: WooCommerce Add Taxonomy to Export
* Plugin URI: https://gist.github.com/helgatheviking/114c8df50cabb7119b3c895b1d854533/
* Description: Add a custom taxonomy to WooCommerce import/export.
* Version: 1.0.1
* Author: Kathy Darling
* Author URI: https://kathyisawesome.com/
*
* Woo: 18716:fbca839929aaddc78797a5b511c14da9
@matthewzring
matthewzring / markdown-text-101.md
Last active May 9, 2024 12:58
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@jessepearson
jessepearson / adding_new_webhook_topics.php
Last active September 14, 2023 10:27
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@firatkucuk
firatkucuk / delete-slack-messages.js
Last active May 1, 2024 04:17
Deletes slack public/private channel messages, private chat messages and channel thread replies.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = 'SLACK TOKEN';
// Legacy tokens are no more supported.
// Please create an app or use an existing Slack App
@Jinksi
Jinksi / gist:d9856f3a053ce7ff29e39d51d6941da0
Created July 5, 2017 23:30
Serverpilot disable display php errors server-wide
echo 'display_errors = false' | sudo tee --append /etc/php5.4-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php5.5-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php5.6-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php7.0-sp/php.ini && echo 'display_errors = false' | sudo tee --append /etc/php7.1-sp/php.ini && cat /etc/php5.4-sp/php.ini && cat /etc/php5.5-sp/php.ini && cat /etc/php5.6-sp/php.ini && cat /etc/php7.0-sp/php.ini && cat /etc/php7.1-sp/php.ini && sudo service php5.4-fpm-sp restart && sudo service php5.5-fpm-sp restart && sudo service php5.6-fpm-sp restart && sudo service php7.0-fpm-sp restart && sudo service php7.1-fpm-sp restart
@OriginalEXE
OriginalEXE / pe-customize-controls.css
Last active June 26, 2023 05:07
Extending WordPress Customizer Panels and Sections to allow nesting
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}
@woogist
woogist / functions.php
Created October 26, 2016 14:04
Dynamic Pricing - Product Ineligible for Discounts
add_filter('woocommerce_dynamic_pricing_process_product_discounts', 'exclude_some_products', 10, 4);
function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) {
if ($product->ID == 200){
$eligible = false;
}
return $eligible;
}
@eugenf
eugenf / woocommerce-enable-free-shipping-per-product.php
Last active June 16, 2017 19:42 — forked from BFTrick/woocommerce-enable-free-shipping-per-product.php
Enable Free Shipping on a per product basis in WooCommerce.
<?php
/**
* Plugin Name: WooCommerce Enable Free Shipping on a Per Product Basis
* Plugin URI: https://gist.github.com/BFTrick/d4a21524a8f7b25ec296
* Description: Enable free shipping for certain products
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0.1
*
* This program is free software: you can redistribute it and/or modify
@kellenmace
kellenmace / get-user-role.php
Last active December 23, 2019 18:27
Get user role in WordPress
<?php
/*
* Get user's role.
*
* If $user parameter is not provided, returns the current user's role.
* Only returns the user's first role, even if they have more than one.
*
* @param mixed $user User ID or object. Pass nothing for current user.
*
* @return string The User's role, or an empty string if none.