Skip to content

Instantly share code, notes, and snippets.

View fearlex's full-sized avatar
🎯
Focused

Arleys Resco fearlex

🎯
Focused
View GitHub Profile
@thenbrent
thenbrent / bs-debugging-helpers.php
Last active September 9, 2019 06:43
A few handy functions for debugging PHP script execution in WordPress/WooCommerce.
<?php
/**
* Plugin Name: Brent's Debugging Helpers
* Plugin URI:
* Description: bs_backtrace() etc.
* Version: 8.13.21
* Author:
* Author URI:
*/
@thenbrent
thenbrent / wcs-test-retry-rules.php
Last active September 8, 2020 14:02
WooCommerce Subscriptions Failed Payment Retry Rules for Testing: Replace the default WooCommerce Subscriptions failed payment retry rules with rules that run every few minutes (not days) and always send dunning emails to help with testing.
<?php
/**
* Plugin Name: WooCommerce Subscriptions Failed Payment Retry Rules for Testing
* Plugin URI:
* Description: Replace the default WooCommerce Subscriptions failed payment retry rules with rules that run every few minutes (not days) and always send dunning emails to help with testing.
* Author: Prospress Inc.
* Author URI: http://prospress.com/
* Version: 1.0
*
* Copyright 2016 Prospress, Inc. (email : [email protected])
add_action( 'woocommerce_order_status_completed', 'change_role_on_purchase' );
function change_role_on_purchase( $order_id ) {
$order = wc_get_order( $order_id );
$items = $order->get_items();
$products_to_check = array( '1', '2', '3' );
foreach ( $items as $item ) {
if ( $order->user_id > 0 && in_array( $item['product_id'], $products_to_check ) ) {
$user = new WP_User( $order->user_id );
anonymous
anonymous / .vmoptions
Created December 9, 2015 13:40
-server
-Xms1500m
-Xmx1500m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=256m
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
@Firsh
Firsh / a.txt
Created August 18, 2015 12:06
All hooks version A/B
>>>>> Ultimate_GetBoxShadow
10 (object) Ultimate_BoxShadow -> ultimate_get_box_shadow (3)
>>>>> WPML_PT_HTML
101 (object) WPML_Package_Translation_HTML_Packages -> loaded (1)
>>>>> WPML_ST_strings_context_language
10 (object) WPML_String_Translation -> get_default_context_language (2)
>>>>> WPML_ST_strings_language
10 (object) WPML_String_Translation -> get_strings_language (1)
>>>>> WPML_current_user
10 (object) SitePress -> get_current_user (0)
@ultimatemember
ultimatemember / gist:643cd90967e5e415378d
Last active June 20, 2020 21:32
Custom profile tab example: showing user pages
/* add a custom tab to show user pages */
add_filter('um_profile_tabs', 'pages_tab', 1000 );
function pages_tab( $tabs ) {
$tabs['pages'] = array(
'name' => 'Pages',
'icon' => 'um-faicon-pencil',
'custom' => true
);
return $tabs;
}
@retlehs
retlehs / header.php
Created April 29, 2015 04:55
Sage header template for Bootstrap top navbar component
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
@ultimatemember
ultimatemember / gist:f7eab149cb33df735b08
Last active May 30, 2024 18:03
Extend Ultimate Member Account page with custom tabs/content
/* add new tab called "mytab" */
add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 );
function my_custom_tab_in_um( $tabs ) {
$tabs[800]['mytab']['icon'] = 'um-faicon-pencil';
$tabs[800]['mytab']['title'] = 'My Custom Tab';
$tabs[800]['mytab']['custom'] = true;
return $tabs;
}

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@Rarst
Rarst / GPLv2.php
Last active August 25, 2024 11:31
WordPress File Templates for PhpStorm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.