Skip to content

Instantly share code, notes, and snippets.

View davidperezgar's full-sized avatar

David Perez davidperezgar

View GitHub Profile
@brenes
brenes / README.md
Last active April 9, 2024 23:24
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país
@setola
setola / function.php
Created August 2, 2012 10:17
Wordpress - excerpt with wysiwyg editor
<?php
/**
* This class removes the default excerpt metabox
* and adds a new box with the wysiwyg editor capability
* @author etessore
*/
class TinyMceExcerptCustomization{
const textdomain = '';
const custom_exceprt_slug = '_custom-excerpt';
@krisnoble
krisnoble / deploy.php
Last active April 25, 2023 15:52
A slightly modified version of Brandon Summers' script. For more information: http://simianstudios.com/blog/post/using-bitbucket-for-automated-deployment-of-multiple-repositories
<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@BFTrick
BFTrick / gettext-filter-multiple.php
Last active March 30, 2023 07:18
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active January 8, 2024 13:24
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@spivurno
spivurno / gp-limit-choices-spots-left.php
Last active July 18, 2020 00:27
Gravity Perks // GP Limit Choices // Display Spots Left in Choice Labels
<?php
/**
* Display how many spots are left in the choice label when using the GP Limit Choices perk
* http://gravitywiz.com/gravity-perks/
*/
add_filter( 'gplc_remove_choices', '__return_false' );
add_filter( 'gplc_pre_render_choice', 'my_add_how_many_left_message', 10, 5 );
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@quickshiftin
quickshiftin / git-transmit
Last active January 1, 2020 16:00 — forked from subtleGradient/git-transmit
Checkout this approach for knowing what to transfer. This revision uses a local tag to track each time you use the command. The first time you use it, it pushes all files in the project. At the end of each run it updates the tag to point to HEAD. Next time you run it, it will only push files that have changed since the last push.
#!/usr/bin/env bash
# author: Thomas Aylott SubtleGradient.com
# author: Nathan Nobbe quickshiftin.com
# Find out where HEAD is pointing
head_ref=$(git show-ref --head -s | head -n 1)
# Check to see if transmit tag exists, and get transmit tag hash
_transmit_ref=$(git show-ref --verify -s refs/tags/transmit)
# If there's not transmit tag, create it for the first time.
@edalis
edalis / remove-url-field-comment-form.php
Last active August 16, 2018 14:23
WP Genesis: Remove URL Field Comment Form
add_filter( 'genesis_comment_form_args', 'url_filtered' );
add_filter( 'comment_form_default_fields', 'url_filtered' );
function url_filtered( $fields ) {
if ( isset( $fields['url'] ) )
unset( $fields['url'] );
if ( isset( $fields['fields']['url'] ) )
unset( $fields['fields']['url'] );