Skip to content

Instantly share code, notes, and snippets.

'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
module.exports = function(grunt) {
grunt.initConfig({
# Compass configuration file.
require 'bootstrap-sass'
project_type = :stand_alone
# Important! change the paths below to match your project setup
sass_dir = "_sass"
css_dir = "_site/assets/stylesheets" # update to the path of your css files.
images_dir = "assets/images" # update to the path of your image files.
javascripts_dir = "assets/javascripts" # update to the path of your script files.
<ul class="ch-grid">
<li>
<div class="ch-item">
<div class="ribbon-wrapper">
<div class="ribbon-front">
<!-- ribbon text goes here -->
<span id="how-to-open"><i class="icomoon-icon-fork"></i>click the + to open</span><span id="how-to-close"><i class="icomoon-icon-fork"></i>click the X to close</span>
<a id="expand-sales"><i id="flipper-switch" class="icomoon-icon-plus"></i></a>
</div>
<div class="ribbon-edge-topleft"></div>
<ul class="ch-grid">
<li>
<div class="ch-item">
<div class="ribbon-wrapper">
<div class="ribbon-front">
<!-- ribbon text goes here -->
<span id="how-to-open"><i class="icomoon-icon-fork"></i>click the + to open</span><span id="how-to-close"><i class="icomoon-icon-fork"></i>click the X to close</span>
<a id="expand-sales"><i id="flipper-switch" class="icomoon-icon-plus"></i></a>
</div>
<div class="ribbon-edge-topleft"></div>
module Jekyll
class MarkdownTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text.strip
end
require "kramdown"
def render(context)
"#{Kramdown::Document.new(File.read(File.join(Dir.pwd, '_includes', @text))).to_html}"
end
module Jekyll
class Excerpt < Liquid::Block
def render(context)
# Get the current post's post object
id = context["page"]["id"]
posts = context.registers[:site].posts
post = posts [posts.index {|post| post.id == id}]
# Put the block contents into the post's excerpt field,
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
// ---
// Sass (v3.2.9)
// ---
// Styling elements based on sibling count
// http://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/
@mixin adjust-form-siblings-count($max: 10, $property: width) {
$i: 0;
@while ($i < $max) {

What if controlling your media queries was as easy as adding on to a Sass list? What if I told you it now is?

This snippet comes from a modified version of mixins in the Aura Responsive Framework and came from me hijacking the respond-to mixin namespace but still wanting to use it for custom media queries. It's a little ugly and requires Sass 3.2+ (for now, (sudo) gem install sass --pre), but it works a charm.

There are two fairly mundane caveats to this method. First, every media query needs to be named. Second, every media query needs a size and assumes min-width and screen. If you want to change min-width, simply add your operator as another option, but if you want to change screen, you need to also include your operator even if you want it to be min-width.

Also, I haven't built in warnings yet for when you do bad things, so bear that in mind.

Without further adue, tada.

#!/bin/sh
GIT_WORK_TREE=/home/myuser/public_html/wp-content/themes/mytheme git checkout -f