This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Pulled from this: https://github.com/adobe-webplatform/balance-text*/ | |
!function(a,b){"use strict";var c=function(a,b,c){var d;return function(){function g(){c||a.apply(e,f),d=null}var e=this,f=arguments;d?clearTimeout(d):c&&a.apply(e,f),d=setTimeout(g,b||100)}};jQuery.fn[b]=function(a){return a?this.bind("resize",c(a)):this.trigger(b)}}(jQuery,"smartresize"),function(a){"use strict";function e(){this.reset()}var d,b=document.documentElement.style,c=b.textWrap||b.WebkitTextWrap||b.MozTextWrap||b.MsTextWrap||b.OTextWrap;e.prototype.reset=function(){this.index=0,this.width=0};var f=function(a,b){var e,c=/\s(?![^<]*>)/g;if(!d)for(d=[];null!==(e=c.exec(a));)d.push(e.index);return-1!==d.indexOf(b)},g=function(b){b.find('br[data-owner="balance-text"]').replaceWith(" ");var c=b.find('span[data-owner="balance-text"]');if(c.length>0){var d="";c.each(function(){d+=a(this).text(),a(this).remove()}),b.html(d)}},h=function(a){return b=a.get(0).currentStyle||window.getComputedStyle(a.get(0),null),"justify"===b.textAlign} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// As of WP 3.1.1 addition of classes for css styling to parents of custom post types doesn't exist. | |
// We want the correct classes added to the correct custom post type parent in the wp-nav-menu for css styling and highlighting, so we're modifying each individually... | |
// The id of each link is required for each one you want to modify | |
// Place this in your WordPress functions.php file | |
function remove_parent_classes($class) { | |
// check for current page classes, return false if they exist. | |
return ($class == 'current_page_item' || $class == 'current_page_parent' || $class == 'current_page_ancestor' || $class == 'current-menu-item') ? FALSE : TRUE; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Not so small grid. | |
How this grid works. | |
To start, give every grid item a class of `c` | |
*/ | |
/*! END OF THE FUCKING GRID */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inline block sorted out with javascript. Plain vanilla javascript. | |
// Technially, this removes unwanted nodes from inside a DOM node | |
var utils = {}; | |
utils.clean = function(node) { | |
var child, i, len = node.childNodes.length; | |
if (len === 0) { return; } | |
// iterate backwards, as we are removing unwanted nodes | |
for (i = len; i > 0; i -= 1) { | |
child = node.childNodes[i - 1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install motion | |
sudo apt-get install ffmpeg | |
nano /etc/motion/motion.conf | |
#turnoff camera | |
webcam_localhost off | |
control_localhost off | |
width 640 | |
height 640 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb | |
require 'watir-webdriver' | |
b = Watir::Browser.new | |
b.goto 'http://demo.woothemes.com/canvas/shop/woo-single-1/' | |
b.button(:class => 'single_add_to_cart_button').click | |
b.goto 'http://demo.woothemes.com/canvas/checkout/' | |
b.text_field(:id => 'billing_first_name').set 'Andrew' | |
b.text_field(:id => 'billing_last_name').set 'Lazarus' | |
b.text_field(:id => 'billing_address_1').set '51 Sneinton Dale' | |
b.text_field(:id => 'billing_city').set 'Nottingham' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
$('.area').on('hover', function(){ | |
$('.area').addClass('unwanted'); | |
$(this).addClass('pick-me'); | |
$(this).removeClass('unwanted'); | |
}); | |
$('.area').on('mouseleave', function(){ | |
$('.area').removeClass('unwanted'); | |
$('.area').removeClass('pick-me'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql; | |
sudo ln -s /Applications/MAMP/Library/bin/mysqlcheck /usr/local/bin/mysqlcheck; | |
sudo ln -s /Applications/MAMP/Library/bin/mysqldump /usr/local/bin/mysqldump |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<object class="svg" data-fallback="/library/images/icons/twitter.png"> | |
<?php include_once(TEMPLATEPATH .'/library/images/icons/twitter.svg'); ?> | |
</object> | |
<style type="scss"> | |
/* Responsive SVGs | |
Svgs don't like their ratio in safari. So we remove the browsers ability to | |
use it's own free will. Then we make the fucking thing work responsively. Neat! */ | |
object.svg { | |
width: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
<!-- Wait! --> | |
jQuery.noConflict(); |