Skip to content

Instantly share code, notes, and snippets.

View rmorse's full-sized avatar

Ross Morsali rmorse

View GitHub Profile
@corsonr
corsonr / gist:9597159
Created March 17, 2014 10:40
jQuery UI Datepicker French localization
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au),
Stéhane Nahmani (sholby@sholby.net),
Stéphane Raimbault <stephane.raimbault@gmail.com> */
jQuery(function($){
$.datepicker.regional['fr'] = {
closeText: 'Fermer',
prevText: 'Précédent',
nextText: 'Suivant',
currentText: 'Aujourd\'hui',
@JeffMatson
JeffMatson / get_actions.php
Last active February 7, 2016 16:54
Prints the actions fired in WordPress, and how many times
<?php
add_action( 'shutdown', function(){
foreach( $GLOBALS['wp_actions'] as $action => $count )
printf( '%s (%d) <br/>' . PHP_EOL, $action, $count );
});
/* start new bbpress */
.bbp-topic-voice-count {
display: none;
}
.bbp-topic-reply-count {
color: #aaa;
font-size: 80%;
margin-right: 20px !important;
width: inherit !important;
@lukin0110
lukin0110 / GulpReactBrowserifyBabelify.md
Last active October 26, 2020 00:36
Gulp + browserify + babelify + react

Use React with Gulp, Browserify and Babelify. This allows you to use React in jsx & node.js style. It let's you use require('module') in your JavaScript. Babelify will transform the jsx code to JavaScript code.

Development

gulp build-react

This will generate a main.min.js file in the build directory with sourcemaps.

Production

@tivnet
tivnet / wc-api-manager-fix-2.php
Last active February 1, 2021 17:49
WooCommerce API Manager: Fix 2
<?php
// plugins/woocommerce-api-manager/includes/class-wc-am-update-api.php
// Add `$response->tested` to show "100% compatible" on the Updates page.
case 'pluginupdatecheck':
$response->id = $post_id;
$response->slug = ! empty( $this->slug ) ? $this->slug : $slug;
$response->plugin = $plugin_name;
$response->new_version = $api_data[ '_api_new_version' ];
$response->url = $api_data[ '_api_plugin_url' ];
@supermethod
supermethod / Wordpress RSS 2.0 image enclosure
Created March 8, 2011 15:09
How to add an enclosure to a wordpress RSS feed using the first image of the post - add to functions.php
function feedFilter($query) {
if ($query->is_feed) {
add_filter('rss2_item', 'feedContentFilter');
}
return $query;
}
add_filter('pre_get_posts','feedFilter');
function feedContentFilter($item) {
@carlalexander
carlalexander / expect-header-fix.php
Last active August 13, 2021 00:40
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = '';
@jonraasch
jonraasch / jQuery.support-transition.js
Created April 21, 2010 14:32
Extends the jQuery.support object to CSS3 transition
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
})();
@wwwebman
wwwebman / docker-compose.yml
Last active February 3, 2023 05:28
Docker Compose For Wordpress, Maria/MYSQL, phpMyAdmin
version: '2'
services:
db:
container_name: database
image: mariadb # Pull mysql image from Docker Hub
ports: # Set up ports exposed for other containers to connect to
- "3306:3306"
volumes:
- ./dep/mysql:/docker-entrypoint-initdb.d
@kasparsd
kasparsd / custom-post-taxonomy-permalinks.php
Created June 13, 2012 15:47
Create permalink structure URLs for custom post types that include all parent terms from a custom taxonomy
<?php
/*
Term Archive Pages:
- http://example.com/recipes/dinner/
- http://example.com/recipes/breakfast,brunch/
Single Recipe Pages:
- http://example.com/recipes/dinner/soup-title/