Skip to content

Instantly share code, notes, and snippets.

View dospuntocero's full-sized avatar

Francisco arenas dospuntocero

View GitHub Profile
@yaronguez
yaronguez / ACF Country List
Created February 17, 2015 01:37
Country list formatted for Advanced Custom Fields select dropdown
afghanistan : Afghanistan
albania : Albania
algeria : Algeria
american_samoa : American Samoa
andorra : Andorra
angola : Angola
anguilla : Anguilla
antigua_and_barbuda : Antigua and Barbuda
argentina : Argentina
armenia : Armenia
@fabrizim
fabrizim / acf-customizer-patch.php
Last active January 17, 2024 02:30
Plugin to allow for Advanced Custom Fields to be used in widgets within the Customizer
<?php
/*
Plugin Name: ACF Customizer Patch
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer.
Author: Mark Fabrizio
Version: 1.0
Author URI: http://owlwatch.com/
*/
class acf_customizer_patch
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@bdmason
bdmason / using-sage-9-blade-templates-for-woocommerce.md
Last active October 26, 2022 10:48
Using Sage 9 blade templates for WooCommerce

Using Sage 9 blade templates for WooCommerce

Declare WooCommerce theme support

Open app/setup.php, find the after_setup_theme action and put add_theme_support('woocommerce'); inside the function.

Override the plugin templates

Add the templates you want to override in resources/woocommerce:

theme    
│
@smutek
smutek / Bootstrap4Nav-Sage9.md
Last active July 30, 2022 06:50
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
@Pushplaybang
Pushplaybang / woo-remove-pretty-photo.php
Created January 29, 2014 14:23
#WordPress #WooCommerce - remove shitty pretty photo lightbox
//Remove prettyPhoto lightbox
add_action( 'wp_enqueue_scripts', 'fc_remove_woo_lightbox', 99 );
function fc_remove_woo_lightbox() {
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
wp_dequeue_script( 'prettyPhoto' );
wp_dequeue_script( 'prettyPhoto-init' );
}
//Add fancyBox lightbox - if thats what you want.
@xjamundx
xjamundx / express-pagination.js
Created April 19, 2011 05:28
sample pagination using express route-specific middleware
// articles per page
var limit = 10;
// pagination middleware function sets some
// local view variables that any view can use
function pagination(req, res, next) {
var page = parseInt(req.params.page) || 1,
num = page * limit;
db.articles.count(function(err, total) {
res.local("total", total);
@sageworksstudio
sageworksstudio / ServerSetup.md
Last active December 29, 2021 15:18
Ubuntu 20.04 LAMP setup

Ubuntu 20.04 LAMP setup

Note: Because this is my personal cheat sheet, I'm installing a few PHP modules that you may not need if you're not running SilverStripe 4.x.x. Otherwise this is a pretty standard and secure LAMP installation.

SECURITY FIRST: Add a sudo user, require public key authentication and disable root login

Log into the remote machine as root: ssh root@123.45.67.890

First, add the admin user.

@felthy
felthy / custom-search-acf-wordpress.php
Last active April 19, 2021 15:11 — forked from fiskhandlarn/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request. Updated to use wpdb prepare() and esc_like().
<?php
/*
##############################
########### Search ###########
##############################
Included are steps to help make this script easier for other to follow
All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10
[list_searcheable_acf list all the custom fields we want to include in our search query]
@return [array] [list of custom fields]
@lolmaus
lolmaus / _heading-sizes.sass
Created December 6, 2013 14:31
A mixin used to generate heading sizes. You provide min and max heading sizes and it calculates all the sizes in between. The sizes can be calculated proportionally or augmented by a ratio. Note that calculating based on a ratio requires the modular-scale extension.
// Requires modular-scale
=heading-sizes($max-size: 30px, $min-size: 16px, $max-heading: 1, $min-heading: 6, $ratio: 1, $debug: false)
$number-of-headings: $min-heading - $max-heading + 1
$scaled-size-of-max-heading: modular-scale($number-of-headings - 1, $min-size, $ratio)
$coefficient: 0
@if $ratio != 1
@if modular-scale(1, 1, octave()) != 2