Skip to content

Instantly share code, notes, and snippets.

View zmonteca's full-sized avatar

zmonteca zmonteca

View GitHub Profile
@zmonteca
zmonteca / cheatsheet-git.sh
Last active July 31, 2019 19:51 — forked from raineorshine/cheatsheet-git.sh
Cheatsheet: git commands
# adding and committing
git add -A # stages All
git add . # stages new and modified, without deleted
git add -u # stages modified and deleted, without new
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed.
git commit --amend --no-edit # Do so without having to edit the commit message.
# remotes - pushing, pulling, and tracking
git fetch # gets remote objects and refs. Needed if new branches were added on the remote.
git remote -v # Lists all remotes (verbose)
<?php
function _s_silence_content_image_sizes_attr($size, $image_src)
{
if (get_page_template_slug() === 'template-full_width.php') {
//Do something here
}
if (!is_array($size) && $size == 'hero-image') {
return false;
}
@zmonteca
zmonteca / form_display.php
Created March 25, 2018 02:31
// line 7 needs a conditions to check if $anchor['id'] exists. if this isn't in place, requesting confirmations asynchronously that completely replace the form bork. Then loading subsequent asyn forms do not work because there is a script error on the page.
if ( $ajax && ! $is_postback ) {
$spinner_url = gf_apply_filters( array( 'gform_ajax_spinner_url', $form_id ), GFCommon::get_base_url() . '/images/spinner.gif', $form );
$scroll_position = array( 'default' => '', 'confirmation' => '' );
if ( $anchor['scroll'] !== false ) {
$scroll_position['default'] = is_numeric( $anchor['scroll'] ) ? 'jQuery(document).scrollTop(' . intval( $anchor['scroll'] ) . ');' : "jQuery(document).scrollTop(jQuery('#gform_wrapper_{$form_id}').offset().top);";
$scroll_position['confirmation'] = is_numeric( $anchor['scroll'] ) ? 'jQuery(document).scrollTop(' . intval( $anchor['scroll'] ) . ');' : "if(jQuery('{$anchor['id']}').length) { jQuery(document).scrollTop(jQuery('{$anchor['id']}').offset().top); }";
}