Skip to content

Instantly share code, notes, and snippets.

@aderaaij
aderaaij / css_resources.md
Created May 31, 2014 13:24 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

$.fn.get_page = function(options) {
// Merge passed options with defaults
var opts = $.extend({}, $.fn.get_page.defaults, options);
return this.each(function() {
$('#ajax-content').addClass('loading');
$('body').addClass('loading');
@aderaaij
aderaaij / SassMeister-input.scss
Created June 17, 2014 16:37
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
// When we give an element some ‘attention’.
@mixin attention() {
&:hover,
&:active,
@aderaaij
aderaaij / addclass.js
Created June 18, 2014 19:35
Sequentially add class to child
// add class to next child
$.fn.add_class = function(options) {
var opts = $.extend({}, $.fn.add_class.defaults, options);
return this.each(function() {
var children = opts.child;
var index = 0;
function addClassToNextChild() {
if (index == children.length) return;
children.eq(index++).addClass(opts.usedclass);
window.setTimeout(addClassToNextChild, opts.delay);
<?php
// Page Slug Body Class
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail_size' );
$url = $thumb['0']; ?>
@aderaaij
aderaaij / wc-dequeue.php
Created July 9, 2014 17:34
Dequeue all woocommerce stylesheets
<?php
// dequeue woocommerce stylesheets
add_filter( 'woocommerce_enqueue_styles', '__return_false' );
<?php
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
@aderaaij
aderaaij / wc-loop-image-wrap.php
Created July 9, 2014 17:39
Add a wrapper around the archive product image: https://gist.github.com/krogsgard/3015581
<?php
/* This snippet removes the action that inserts thumbnails to products in teh loop
* and re-adds the function customized with our wrapper in it.
* It applies to all archives with products.
*
* @original plugin: WooCommerce
* @author of snippet: Brian Krogsard
*/
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
@aderaaij
aderaaij / wc-remove-single-product-salesflash.php
Created July 9, 2014 17:40
Remove sales flash on single product
<?php
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );