Skip to content

Instantly share code, notes, and snippets.

View GarySwift's full-sized avatar

Gary Swift GarySwift

  • Waterford City, Ireland
View GitHub Profile
@cviebrock
cviebrock / select2-foundation5.css
Created December 20, 2013 15:56
Select2 CSS for Zurb Foundation 5
/*
Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013
*/
.select2-container {
margin: 0 0 1rem 0;
position: relative;
vertical-align: middle;
font-family: inherit;
-webkit-appearance: none !important;
font-size: 0.875rem;
@isGabe
isGabe / wp_custom_title_placeholder_text.php
Last active February 25, 2019 21:28
WordPress: Custom placeholder text for custom post type title input box #snippet #WordPress
<?php
/*
replacing the default "Enter title here" placeholder text in the title input box
with something more descriptive can be helpful for custom post types
place this code in your theme's functions.php or relevant file
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963
*/
source ~/.profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# The inspiration for this file can be found: https://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
@themepaint
themepaint / Woocommerce Price Filter CSS
Created February 2, 2016 08:20
Woocommerce Price Filter CSS
.price_slider{
margin-bottom: 1em;
}
.price_slider_amount {
text-align: right;
line-height: 2.4em;
font-size: 0.8751em;
}
@superbiche
superbiche / wp-autosave-not-draft.php
Created November 26, 2015 15:40
Wordpress save_post action, that doesn't fire when autosaving.
add_action('save_post', 'my_post_saved');
function my_post_saved($post_id, $post) {
if (isset($post->post_status) && 'auto-draft' == $post->post_status) {
return;
}
// Autosave, do nothing
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
@derweili
derweili / disable-acf-blocks-on-edit.js
Last active April 29, 2022 17:09
Disable Links in ACF Block-Edit Method
/*
* Wrap all ACF Blocks in Disabled block to disable all links in edit view
*/
const { createHigherOrderComponent } = wp.compose;
const { Fragment } = wp.element;
import { Disabled } from '@wordpress/components';
const withDisabledCompontent = createHigherOrderComponent( ( BlockEdit ) => {
return ( props ) => {
@carlodaniele
carlodaniele / custom_menu_admin.php
Last active May 26, 2022 20:32
A basic plugin showing how to add menu metaboxes to admin menu page
<?php
/**
* @package Custom_menu_admin
* @version 1.0
*/
/*
Plugin Name: Custom menu admin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@MrTomek
MrTomek / EloquentCheatSheet.md
Last active September 1, 2022 13:54 — forked from avataru/EloquentCheatSheet.md
Eloquent relationships cheat sheet
@PoeHaH
PoeHaH / gist:ab9d8ac1b4ddee168d4d96c71797df31
Last active November 21, 2022 11:12
JSON representation of EU countries, 2 letter codes and VAT amounts. Good to check the EU VIES database
var euList =
[
{country:'Austria',code:'AT',vat:20},
{country:'Belgium',code:'BE',vat:21},
{country:'Bulgaria',code:'BG',vat:20},
{country:'Croatia',code:'HR',vat:25},
{country:'Cyprus',code:'CY',vat:19},
{country:'Czech Republic',code:'CZ',vat:21},
{country:'Denmark',code:'DK',vat:25},
{country:'Estonia',code:'EE',vat:20},
<?php
// force download of CSV
// simulate file handle w/ php://output, direct to output (from http://www.php.net/manual/en/function.fputcsv.php#72428)
// (could alternately write to memory handle & read from stream, this seems more direct)
// headers from http://us3.php.net/manual/en/function.readfile.php
header('Content-Description: File Transfer');
header('Content-Type: application/csv');
header("Content-Disposition: attachment; filename=FILENAME.csv");
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');