Skip to content

Instantly share code, notes, and snippets.

@mitchmccline
mitchmccline / SCSS CodeKit WordPress Theme Development Helper
Last active January 8, 2016 03:26
SCSS CodeKit WordPress - This is some Ruby that I found that I use while developing WordPress themes with Compass via CodeKit. In the config.rb file that is generated by CodeKit when Compass is installed on a project. When the styles.css file is saved in the css subfolder the code below will take the file and move it to the root of your WP theme…
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
preferred_syntax = :scss
require 'fileutils'
on_stylesheet_saved do |file|
if File.exists?(file) && File.basename(file) == "style.css"
@mitchmccline
mitchmccline / wordpress-codepen-quick-link-embed.php
Last active December 30, 2015 16:19
WordPress CodePen Quick Link Embed - WP Embed Register Handler for CodePen embedded pens in posts from the pen url that is pasted into the wp editor. Using regex to pull the username and pen id slug hash from any CodePen pen link in order to register the embed handler in WordPress. http://codex.wordpress.org/Function_Reference/wp_embed_register_…
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
<input type="text" placeholder="your@email.com" name="email" id="address" data-validate="validate(required, email)"/>
/* =============================================================================
CSS Declarations
========================================================================== */
/* ==|== The Standard Way =================================================== */
.foo::before {
/* ...css rules... */
}
@mitchmccline
mitchmccline / index.html
Created May 18, 2013 16:28
A CodePen by Chris Coyier. Slider like Yahoo Weather App
<div class="slider-wrap">
<div class="slider" id="slider">
<div class="holder">
<div class="slide" id="slide-0"><span class="temp">74°</span></div>
<div class="slide" id="slide-1"><span class="temp">64°</span></div>
<div class="slide" id="slide-2"><span class="temp">82°</span></div>
</div>
</div>
<nav class="slider-nav">
<a href="#slide-0" class="active">Slide 0</a>
@mitchmccline
mitchmccline / index.html
Created May 13, 2013 04:17
A CodePen by mitchmc. CSS only Custom Radio and Checkboxes - Based on the webdesign tuts+ article (link below) but instead of using images I used only css. http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-easy-css3-checkboxes-and-radio-buttons/
<div>
<input type="checkbox" id="check01" name="check" />
<label for="check01"><span></span>Check Box 1</label>
</div>
<div>
<input type="checkbox" id="check02" name="check" />
<label for="check02"><span></span>Check Box 2</label>
</div>