Skip to content

Instantly share code, notes, and snippets.

View tddewey's full-sized avatar

Taylor Dewey tddewey

View GitHub Profile
@tddewey
tddewey / SassMeister-input-HTML.html
Created August 20, 2014 05:59
Generated by SassMeister.com.
<div class="join-now">
Inverted Block
</div>
<p>Normal Paragraph</p>
@tddewey
tddewey / SassMeister-input-HTML.html
Created August 20, 2014 05:55
Generated by SassMeister.com.
<div class="inverted-block">
Inverted Block
</div>
<p>Normal Paragraph</p>
@tddewey
tddewey / vvv.json
Created August 3, 2014 07:53
generator-vvv example
{
"site": {
"name": "A Vetted VVV Venture",
"url": "generator-vvv.dev",
"liveUrl": "http://wpthemetestdata.wordpress.com/"
},
"remoteDatabase": {
"url": "http://dbuser:dbpassword@future.tddewey.com/remote-databases/generator-vvv.sql"
},
"wordpress": {
@tddewey
tddewey / _mixin-edge-skew.scss
Created June 29, 2014 19:07
Edge skew mixin from GeekyLibrary
// edge-skew
// Applies a psudo element ot the left or right of an element
// that skews that edge. Basically adds a triangle of a given
// color in a direction
// @param $direction 'left'|'right'
// @param $color color
@mixin edge-skew( $direction, $color ) {
position: relative;
$pseudo: if($direction == left, before, after);
@tddewey
tddewey / autoprefixer-ready.css
Created April 3, 2014 23:12
Some CSS for autoprefixer to chew on
* {
box-sizing: border-box;
}
.content {
background-image: linear-gradient(to bottom, #b4ddb4 0%,#83c783 17%,#52b152 33%,#008a00 67%,#005700 83%,#002400 100%);
column-count: 2;
column-gap: 1em;
}
@tddewey
tddewey / gruntfile-snippet.js
Created April 3, 2014 23:10
Autoprefixer sample grunt configuration for wp_theme demo
autoprefixer: {
options: {
browsers: ['ie 8', 'ie 9', 'last 2 version']
},
all: {
files: {
'assets/css/wp_theme.src.css' : 'assets/css/wp_theme.src.css'
}
}
}
@tddewey
tddewey / gist:9771710
Created March 25, 2014 21:23
Smarter Truncate
/*
* Truncate text to a number of characters somewhat intellegently...
*
* Truncates text to a number of characters, but preserves the word. Strips ending punctuation. Will always err on the side of returning more than less.
* Props to alishahnovin at hotmail dot com who posted this at php.net
*
* @param str $text Text to truncate
* @param int $numb Number of characters to truncate to
* @param str $etc Ending. Default is an ellipsis
* @return str Returns the truncated text
@tddewey
tddewey / dabblet.css
Created January 11, 2014 17:15
Animated porthole
/**
* Animated porthole
*/
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
@tddewey
tddewey / kses.php
Created October 28, 2013 18:30
Kses whitelist for 'posts'
$allowedposttags = array(
'address' => array(),
'a' => array(
'href' => true,
'rel' => true,
'rev' => true,
'name' => true,
'target' => true,
),
'abbr' => array(),
@tddewey
tddewey / admin.js
Created September 11, 2013 01:05
In javascript, do something if the featured image (post thumbnail) is updated
// Do something if the featured image is updated by inspecting ajaxComplete callback
jQuery(document).ajaxComplete(function(event, xhr, settings){
// Parse the request
var vars = {};
var requestVars = settings.data.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
vars[key] = value;
});
// Take action if the action parameter is for the thumbnail