Skip to content

Instantly share code, notes, and snippets.

View warengonzaga's full-sized avatar

Waren Gonzaga warengonzaga

View GitHub Profile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@cadams500
cadams500 / git-tag-sync
Created February 24, 2012 17:55
Synchronize Git Tags With Remote
git tag -l | xargs git tag -d
git fetch
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active July 6, 2024 15:54
Using Git with Subversion Mirroring for WordPress Plugin Development
@digitaljhelms
digitaljhelms / gist:4287848
Last active July 25, 2024 08:06
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@nikolov-tmw
nikolov-tmw / multiple-roles-per-user.php
Last active October 5, 2021 03:56
Multiple roles per user WordPress plugin.
<?php
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*
@renventura
renventura / remove-divi-project-post-type.php
Last active November 27, 2022 02:07
Remove the Projects Post Type from Divi by Elegant Themes
<?php //* Mind this opening php tag
/**
* This will hide the Divi "Project" post type.
* Thanks to georgiee (https://gist.github.com/EngageWP/062edef103469b1177bc#gistcomment-1801080) for his improved solution.
*/
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 );
function mytheme_et_project_posttype_args( $args ) {
return array_merge( $args, array(
'public' => false,
@spivurno
spivurno / gw-gravity-forms-force-default-value.php
Last active October 20, 2021 10:42
Gravity Wiz // Gravity Forms // Force Default Value
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-force-default-value.php
*/
/**
* Gravity Wiz // Gravity Forms // Force Default Value
*
* Force the default value to be captured for fields hidden by conditional logic.
@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
@cristacheda
cristacheda / Advanced Custom Fields repeater values to a Gravity Forms dropdown field.md
Last active August 26, 2022 03:47
Populate Gravity Forms dropdown field with Advanced Custom Fields repeater values.

Add Advanced Custom Fields repeater values to a Gravity Forms dropdown field

The code should be added in a separate file and then included in your functions.php using require.

Replace 1 from the code with the ID of the form that you want to dinamically populate with field values from ACF. You can find more info about the filters in the Gravity Forms documentation.

add_filter( 'gform_pre_render_1', 'populate_dropdown' );
add_filter( 'gform_pre_validation_1', 'populate_dropdown' );
add_filter( 'gform_admin_pre_render_1', 'populate_dropdown' );
add_filter( 'gform_pre_submission_filter_1', 'populate_dropdown' );