Skip to content

Instantly share code, notes, and snippets.

View carlitoescobar's full-sized avatar
👁️
Looking

Carlito carlitoescobar

👁️
Looking
View GitHub Profile
<?php // custom functions.php template @ digwp.com
// add feed links to header
if (function_exists('automatic_feed_links')) {
automatic_feed_links();
} else {
return;
}
describe('conditional testing', function() {
it('should be able to test conditionally', function() {
browser.get('http://www.angularjs.org');
element(by.css('.theresnowaythisclassexists')).then(
function elementExists() {
expect(false).toBe(true);
},
function elementDoesNotExist() {
expect(true).toBe(true);
}
@carlitoescobar
carlitoescobar / functions.php
Created October 10, 2018 17:47 — forked from AMNDesign/functions.php
Dynamically populate Gravity Forms fields with WordPress user info for logged in users using get_currentuserinfo().
<?php
//* Using the Gravity Forms editor, be sure to check "Allow field to be populated dynamically under Advanced Options
//* You will need to set the Field Parameter Name value to work with the filter as follows: gform_field_value_$parameter_name
//* Dynamically populate first name for logged in users
add_filter('gform_field_value_first_name', 'populate_first_name');
function populate_first_name($value){
global $current_user;
get_currentuserinfo();
return $current_user->user_firstname;
@carlitoescobar
carlitoescobar / config.yml
Created October 11, 2019 02:21 — forked from brettchalupa/config.yml
Shopify Theme Kit config example for screencast (https://www.youtube.com/watch?v=1xWFsYmBoX0)
development:
store: example.myshopify.com
password: add-password-in-config
theme_id: "live"
bucket_size: 40
refill_rate: 2
ignore_files:
- "*.swp"
- "*~"
- "config/settings_data.json"
@carlitoescobar
carlitoescobar / Quantity Discounts
Last active December 5, 2020 21:38 — forked from bhays/Quantity Discounts
Auto discount prices based on quantities in Gravity Forms. Uses a percentage based approach.
(function($){
$.fn.quantityDiscounts = function(options) {
// set up default options
var defaults = {
discountColor: '#FF0000',
discounts: [
{ limit: 174, discount: .75, text: "25% Discount Applied"},
{ limit: 139, discount: .80, text: "20% Discount Applied"},
@carlitoescobar
carlitoescobar / install nano.sh
Created December 10, 2020 06:53 — forked from BlakeGardner/install nano.sh
Syntax highlighting in nano on Mac OS
# install Homebrew if you don't already have it: http://mxcl.github.io/homebrew/
# install nano from homebrew
brew install nano
# update your nanorc file with the contents of the nanorc file below
nano ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
(function($){
$.fn.quantityDiscounts = function(options) {
// set up default options
var defaults = {
discountColor: '#FF0000',
discounts: [
{ limit: 174, discount: .75, text: "25% Discount Applied"},
{ limit: 139, discount: .80, text: "20% Discount Applied"},
@carlitoescobar
carlitoescobar / functions.php
Created June 29, 2021 20:22 — forked from cliffordp/functions.php
Automatically login a single WordPress user upon arrival to a specific page.
<?php
/**
* Automatically login a single WordPress user upon arrival to a specific page.
*
* Redirect to home page once logged in and prevent viewing of the login page.
* Compatible with WordPress 3.9.1+
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1.
*
@carlitoescobar
carlitoescobar / gist:54fd0fba733fe1290cc1681bde931193
Created March 23, 2022 20:57 — forked from NikV/gist:bb1ca7ce478c0c60d155
Examples for: gform_post_payment_callback
/**
* Send a notification after a user attempts a purchase
*
* @param $entry The Entries object
* @param array $action The Action Object
* $action = array(
* 'type' => 'cancel_subscription', // See Below
* 'transaction_id' => '', // What is the ID of the transaction made?
* 'subscription_id' => '', // What is the ID of the Subscription made?
@carlitoescobar
carlitoescobar / gist:8ab734d123bfc8f39520e6ec8d692872
Created March 23, 2022 20:57 — forked from NikV/gist:7b7ec046df69b1f390bf
Example for: gform_post_payment_completed
/**
* Fires after a payment has been completed
*
* @param array $entry The Entry object
* @param array $action The Action Object
* $action = array(
* 'type' => 'cancel_subscription', // See Below
* 'transaction_id' => '', // What is the ID of the transaction made?
* 'subscription_id' => '', // What is the ID of the Subscription made?
* 'amount' => '0.00', // Amount to charge?