Skip to content

Instantly share code, notes, and snippets.

Ross Morsali rmorse

Block or report user

Report or block rmorse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wwwebman
wwwebman / docker-compose.yml
Last active Jul 2, 2019
Docker Compose For Wordpress, Maria/MYSQL, phpMyAdmin
View docker-compose.yml
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
@JeffMatson
JeffMatson / get_actions.php
Last active Feb 7, 2016
Prints the actions fired in WordPress, and how many times
View get_actions.php
<?php
add_action( 'shutdown', function(){
foreach( $GLOBALS['wp_actions'] as $action => $count )
printf( '%s (%d) <br/>' . PHP_EOL, $action, $count );
});
@Restuta
Restuta / framework-sizes.md
Last active Aug 21, 2019
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)
View framework-sizes.md

Below is the list of modern JS frameworks and almost frameworks – Angular, Ember and React.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan  4 22:03 angular2.min.js
@lukin0110
lukin0110 / GulpReactBrowserifyBabelify.md
Last active Aug 7, 2019
Gulp + browserify + babelify + react
View GulpReactBrowserifyBabelify.md

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

View gist:eb3c5b834e65b3a76756
/* 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;
@corsonr
corsonr / gist:9597159
Created Mar 17, 2014
jQuery UI Datepicker French localization
View gist:9597159
/* 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',
@kasparsd
kasparsd / custom-post-taxonomy-permalinks.php
Created Jun 13, 2012
Create permalink structure URLs for custom post types that include all parent terms from a custom taxonomy
View custom-post-taxonomy-permalinks.php
<?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/
@mikejolley
mikejolley / functions.php
Last active Aug 7, 2018
WooCommerce - Show quantity inputs for simple products within loops.
View functions.php
<?php
/**
* Code should be placed in your theme functions.php file.
*/
add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 );
function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">';
$html .= woocommerce_quantity_input( array(), $product, false );
@supermethod
supermethod / Wordpress RSS 2.0 image enclosure
Created Mar 8, 2011
How to add an enclosure to a wordpress RSS feed using the first image of the post - add to functions.php
View Wordpress RSS 2.0 image enclosure
function feedFilter($query) {
if ($query->is_feed) {
add_filter('rss2_item', 'feedContentFilter');
}
return $query;
}
add_filter('pre_get_posts','feedFilter');
function feedContentFilter($item) {
@jonraasch
jonraasch / jQuery.support-transition.js
Created Apr 21, 2010
Extends the jQuery.support object to CSS3 transition
View jQuery.support-transition.js
// 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;
})();
You can’t perform that action at this time.