Skip to content

Instantly share code, notes, and snippets.

View matthewcrist's full-sized avatar

Matthew Crist matthewcrist

View GitHub Profile
@matthewcrist
matthewcrist / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

javascript:

var pp = "/images/test/images_";
var images_p1 = [ pp + '1.jpg', pp + '2.jpg', pp + '3.jpg', pp + '4.jpg', pp + '5.jpg' ];
var images_p2 = [ pp + '6.jpg', pp + '7.jpg', pp + '8.jpg', pp + '9.jpg', pp + '10.jpg' ];

$('.preview').slideview(function(e) { return e.id == "p1" ? images_p1 : images_p2; }, {width: 100, height: 100});

html:

A couple helpers to help you figure out if you're within a category in Wordpress. A slight modification of code found here...
http://olykrap.com/post/how-to-check-for-category-descendants/
.element {
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#1E63B8), to(#09121C), color-stop(.5,#143D70), color-stop(.5,#052F62));
border: 1px solid rgba(0,0,0,0.25)
}
<svg height="300" width="350" version="1.1" xmlns="http://www.w3.org/2000/svg">
<script type="application/ecmascript">//<![CDATA[
function removeAndUpdate(el) {
var cliprect = document.getElementById('cliprect');
// remove the path
//el.setAttribute('clip-path', 'none'); // doesn't help
el.parentNode.removeChild(el);
// update the clipping
<script>window.jQuery || document.write("<script src='js/libs/jquery-1.5.1.min.js'>\x3C/script>")</script>
display: -webkit-box;
display: -moz-box;
display: box;
@matthewcrist
matthewcrist / box-orient.css
Created April 14, 2011 13:30
Flexible box model orient
/* Places children side by side */
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
box-orient: horizontal;
/* Places children in block layout */
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-orient: vertical;
@matthewcrist
matthewcrist / create_gemset.sh
Created September 11, 2011 02:12
Homebrew, RVM & Rails on OS X Lion
rvm gemset create base
@matthewcrist
matthewcrist / gist:1840862
Created February 16, 2012 01:53
WebKit Proprietary CSS Properties
-webkit-box-reflect
-webkit-text-stroke
-webkit-mask
-webkit-text-size-adjust
-webkit-tap-highlight-color
-webkit-text-fill-color