Skip to content

Instantly share code, notes, and snippets.

View ianpegg's full-sized avatar

Ian Pegg ianpegg

View GitHub Profile
@sagarjadhav
sagarjadhav / contact-form-7.html
Last active September 9, 2016 14:01
Contact Form 7 Markup with Sass
<!-- Misc Form -->
<div class="rtp-form-field"><label for="your-name">Your Name <span class="required">*</span></label>[text* your-name id:your-name]</div>
<div class="rtp-form-field"><label for="contact-email">Email <span class="required">*</span></label>[email* email id:contact-email]</div>
<div class="rtp-form-field"><label for="company-name">Company Name <span class="required">*</span></label>[text* company-name id:company-name]</div>
<div class="rtp-form-field"><label for="street-address">Street Address</label>[text street-address id:street-address]</div>
<div class="rtp-form-field"><label for="apartment-suite">Apartment/Suite</label>[text apartment-suite id:apartment-suite]</div>
<div class="rtp-form-field"><label for="city">City</label>[text city id:city]</div>
<div class="rtp-form-field"><label for="state">State</label>[text state id:state]</div>
<div class="rtp-form-field"><label for="zip">Zip <span class="required">*</span></label>[text* zip id:zip]</div>
<div class="rtp-form-field"><label for="pho
@josheinstein
josheinstein / gist:5586469
Last active October 15, 2022 02:13
Handle back button issues with Twitter Bootstrap's tab component.
// Handle back button issues with Twitter Bootstrap's tab component.
// Based on: http://stackoverflow.com/a/10120221/81769
// It has been changed to avoid the following side effects:
// - Switching tabs was being added to navigation history which is undesirable
// (Worked around this by using location.replace instead of setting the hash property)
// - Browser scroll position was lost due to fragment navigation
// (Worked around this by converting #id values to #!id values before navigating.)
$(document).ready(function () {
if (location.hash.substr(0,2) == "#!") {
@barbwiredmedia
barbwiredmedia / functions.php
Last active February 23, 2023 23:55
Wordpress SEO Yoast Order meta box. This will change the priority of Yoasts meta box and move it to the bottom of all pages / posts.
// Move Yoast Meta Box to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@mwinters0
mwinters0 / gist:c70d195c5c5670d1625f
Created November 10, 2014 19:43
Shell one-liner to parse apache access logs and extract a unique URL list with hit count, querystring excluded.
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sed 's/\?.*//g' | sort | uniq -c | sort -rn > url_hits.txt
@onnimonni
onnimonni / composer.json
Last active January 25, 2021 20:42
composer.json for latest Wordpress using johnpbloch/wordpress and languages.koodimonni.fi. This file has also an example of how to handle wordpress dropin-files (e.g. object-cache.php, sunrise.php, ...) using composer.json
{
"repositories": [
{
"type": "composer",
"url": "https://wp-languages.github.io"
},
{
"type": "composer",
"url": "https://wpackagist.org"
}
@amboutwe
amboutwe / wordpress_robots_custom.php
Last active April 2, 2025 14:22
Filters and example code for Yoast SEO robots or WP robots.txt
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Replace Disallow with Allow Generated Robots.txt
* Credit: Unknown
* Last Tested: June 09 2020 using WordPress 5.4.1
*/
add_filter('robots_txt','custom_robots');
@freddielore
freddielore / yoast-faq.css
Last active March 23, 2022 16:53
[Yoast SEO FAQ] Add collapsible headers support to Yoast SEO FAQ schema
/* Accordion
------------------------------------------------------------ */
.schema-faq-question{
cursor: pointer;
}
.schema-faq-question:before{
width: 16px;
height: 20px;
display: inline-block;
@pagegwood
pagegwood / the-events-calendar.php
Created February 20, 2020 19:07
Remove (dequeue) all CSS and Javascript files loaded by the free version of The Events Calendar WordPress plugin by Modern Tribe (created using version 5.0.2 of the plugin)
<?php
// include this in functions.php
add_action( 'wp_enqueue_scripts', function() {
//this is based on using the "skeleton styles" option
$styles = [
'tribe-events-bootstrap-datepicker-css',
'tribe-events-calendar-style',
'tribe-events-custom-jquery-styles',
@zamaldev
zamaldev / PSR-12.md
Created February 19, 2021 15:35
PSR-12: Extended Coding Style

PSR-12: Extended Coding Style

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.

This specification extends, expands and replaces PSR-2, the coding style guide and requires adherence to PSR-1, the basic coding standard.

Like PSR-2, the intent of this specification is to reduce cognitive friction when scanning code from different authors. It does so by enumerating a shared set of rules and expectations about how to format PHP code. This PSR seeks to provide a set way that coding style tools can implement, projects can declare adherence to and developers can easily relate to between different projects. When various authors collaborate across multiple projects, it helps to have one set of guidelines to be used among