This file contains 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
#!/usr/bin/env bash | |
# | |
# Bootstrap script for setting up a new OSX machine | |
# | |
# This should be idempotent so it can be run multiple times. | |
# | |
# Some apps don't have a cask and so still need to be installed by hand. These | |
# include: | |
# | |
# - Newton (app store) |
This file contains 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 | |
/** | |
* WordPress Query Comprehensive Reference. | |
* | |
* All credits go to luetkemj. Thanks! | |
* | |
* @author luetkemj <luetkemj@gmail.com> | |
* @author s3rgiosan <me@s3rgiosan.com> | |
* | |
* @see http://codex.wordpress.org/Class_Reference/WP_Query#Parameters |
This file contains 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
@each $font-face in | |
"MyFont-Regular", | |
"MyFont-Bold", | |
"MyFont-Medium" { | |
@font-face { | |
font-family: $font-face; | |
font-style: normal; font-weight: normal; | |
src: font-url('#{$font-face}.eot'); | |
src: font-url('#{$font-face}.eot?#iefix') format('embedded-opentype'), |
This file contains 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
<div class="container"> | |
<ul> | |
<li id="pink">Pink</li> | |
<li id="salmon">Salmon</li> | |
<li id="blue">Blue</li> | |
<li id="green">Green</li> | |
<li id="red">Red</li> | |
</ul> | |
</div> |
This file contains 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
javascript: (function() { | |
var root = angular.element(document.getElementsByTagName('html')); | |
var watchers = []; | |
var attributes = []; | |
var attributes_with_values = []; | |
var elements = []; | |
var elements_per_attr = []; | |
var scopes = []; |
This file contains 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
/*! | |
* $.preload() function for jQuery – http://mths.be/preload | |
* Preload images, CSS and JavaScript files without executing them | |
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading. | |
*/ | |
jQuery.preload = function(array) { | |
var length = array.length, |
This file contains 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
// MIT License | |
// @return {float} a random number between min and max | |
function getRandom(min, max) { | |
return Math.random() * (max - min) + min; | |
} | |
// @return {integer} a random int between min and max | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min); |
This file contains 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
function google_fonts() { | |
$query_args = array( | |
'family' => 'Open+Sans:400,700|Oswald:700' | |
'subset' => 'latin,latin-ext', | |
); | |
wp_register_style( 'google_fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null ); | |
} | |
add_action('wp_enqueue_scripts', 'google_fonts'); |
This file contains 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 | |
// a.php: assuming this included everywhere at very first line | |
// and located in root directory | |
// preferable, define a constant instead of variable, cos it | |
// may used in functions directly without "global $ROOT"; | |
// to use for "include" | |
define('ROOT', __DIR__); // for PHP >= 5.3 | |
define('ROOT', realpath(dirname(__FILE__))); // for PHP < 5.3 | |
// to use for "src,href" |
This file contains 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
// Remove each style one by one | |
add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' ); | |
function jk_dequeue_styles( $enqueue_styles ) { | |
unset( $enqueue_styles['woocommerce-general'] ); // Remove the gloss | |
unset( $enqueue_styles['woocommerce-layout'] ); // Remove the layout | |
unset( $enqueue_styles['woocommerce-smallscreen'] ); // Remove the smallscreen optimisation | |
return $enqueue_styles; | |
} | |
// Or just remove them all in one line |
NewerOlder