Skip to content

Instantly share code, notes, and snippets.

@jackw
jackw / SassMeister-input.scss
Created November 5, 2013 10:42
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
%my-placeholder {
background:black;
padding:20px;
position:relative;
color:red;
@jameskoster
jameskoster / functions.php
Created November 4, 2013 23:11
WooCommerce - Disable CSS for WooCommerce 2.1 and below
if ( version_compare( WOOCOMMERCE_VERSION, "2.1" ) >= 0 ) {
add_filter( 'woocommerce_enqueue_styles', '__return_false' );
} else {
define( 'WOOCOMMERCE_USE_CSS', false );
}
@jackw
jackw / _defeat-fout.scss
Created September 25, 2013 16:55
Defeat Typekit FOUT with SASS I've been working on a large website with Typekit and needed a way to chain selectors with the Typekit FOUT css rather than (http://help.typekit.com/customer/portal/articles/6852-controlling-the-flash-of-unstyled-text-or-fout-using-font-events). Extending a class in SASS generally causes bloat but I'm thinking it mi…
// How about we try some FOUT fixing with SASS...
// a fallback if people forget to set the stack.
$default-font-stack: "Museo-sans", "Helvetica Neue", Arial, Helvetica, sans-serif !default;
// we'll extend these in some sort of attempt to chain selectors without needing to worry about it.
.visible-hidden {
visibility:hidden;
}
@MikeRogers0
MikeRogers0 / backup-to-s3.sh
Last active May 19, 2020 15:33
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="you@yourdomain.com"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@jeanlaurent
jeanlaurent / gist:5474503
Created April 27, 2013 20:08
Jekyll with complex data in the YAML front matter parsed by liquid template
---
products:
- {prix: 17, name: mon-cahier-3, description: "<a href='mailto:someone@morlhon.net?subject=test%20test'>jl</a>"}
- {prix: 18, name: mon-cahier-7, description: "<h1>TEST</h1>"}
---
<html>
<head>
<title>Jekyll test</title>
</head>
<body>
@jameskoster
jameskoster / functions.php
Created March 11, 2013 11:15
WooCommerce - Reorder product tabs
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['reviews']['priority'] = 5; // Reviews first
$tabs['description']['priority'] = 10; // Description second
$tabs['additional_information']['priority'] = 15; // Additional information third
return $tabs;
}
@hzlzh
hzlzh / jQuery.fn.shake.js
Created August 6, 2012 04:51
jQuery shake effect like WordPress Login Form
jQuery.fn.shake = function(intShakes, intDistance, intDuration) {
this.each(function() {
$(this).css({
position: "relative"
});
for (var x = 1; x <= intShakes; x++) {
$(this).animate({
left: (intDistance * -1)
}, (((intDuration / intShakes) / 4))).animate({
left: intDistance
@jackreichert
jackreichert / gist-shortcode.php
Last active September 27, 2017 15:44
WordPress Gist ShortCode
// github gist Shortcode Usage: [gist un="" id=""]
function gist_shortcode( $atts ) {
extract(shortcode_atts(array(
'un' => '',
'id' => ''
), $atts));
return '<script src="https://gist.github.com/' . $username . '/' . $id.'.js"></script>';
}
add_shortcode('gist', 'gist_shortcode');
@ocean90
ocean90 / gist:1544377
Created December 31, 2011 15:43
Compiling Compass.app on Mac OS X
Tutorial for compiling the Compass.app (http://compass.handlino.com/)
=====================================================================
Java installed?
java -version
Load jRuby (for example JRuby 1.6.5.1 Binary .zip)
http://jruby.org/download
Unzip jRuby to `/usr/local/`