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
<IfModule mod_expires.c> | |
# Enable expirations | |
ExpiresActive On | |
# Default directive | |
ExpiresDefault "access plus 1 month" | |
# My favicon | |
ExpiresByType image/x-icon "access plus 1 year" | |
# Images | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/png "access plus 1 month" |
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
<IfModule mod_headers.c> | |
<FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$"> | |
Header set Access-Control-Allow-Origin "*" | |
</FilesMatch> | |
</IfModule> | |
<IfModule mod_mime.c> | |
# Web fonts | |
AddType application/font-woff woff | |
AddType application/vnd.ms-fontobject eot |
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
# EditorConfig is awesome: http://EditorConfig.org | |
# Remember to install a plugin https://github.com/sindresorhus/atom-editorconfig | |
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines with a newline ending every file | |
[*] | |
end_of_line = lf | |
insert_final_newline = 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
@mixin image-aspect($ratio) { | |
position: relative; | |
height: auto; | |
display: block; | |
&:before { | |
display: block; | |
content: ""; | |
width: 100%; | |
padding-top: percentage(1/$ratio); |
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 $ = require( 'jquery' ), | |
throttle = require( 'modules/throttle' ); | |
module.exports = function( el ) { | |
var $el = $( el ), | |
$window = $( window ), | |
$bar = $( '#bottom-bar' ), | |
$close = $bar.find('.close-icon'), | |
$footer = $( '.footer' ); |
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
(function($,sr){ | |
// debouncing function from John Hann | |
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ | |
var debounce = function (func, threshold, execAsap) { | |
var timeout; | |
return function debounced () { | |
var obj = this, args = arguments; | |
function delayed () { |
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
/* Hook */ | |
add_action( 'admin_head', 'load_custom_fonts' ); | |
/* Function */ | |
function load_custom_fonts() { | |
echo '<link type="text/css" rel="stylesheet" href="' . get_template_directory_uri() .'/assets/css/editor.min.css">'; | |
} |
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
Grab the 'PHP Remote Debugging Client' (the pre-complied xdebug binary for OSX) from here: | |
http://code.activestate.com/komodo/remotedebugging/ | |
Unzip it, find the folder that corresponds to the version of PHP you want to install it for and copy the xdebug.so file from there into your php extensions folder in the relevant PHP version directory. E.g. for PHP 5.4: | |
/Applications/AMPSS/php-5.4/lib/extensions/ext/ | |
Now open PHP.ini in a text editor: | |
/Applications/AMPSS/php-5.4/etc/php.ini |
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
// Register and load the widget | |
function load_custom_widgets() { | |
register_widget( 'ebook_cat_menu' ); | |
} | |
add_action( 'widgets_init', 'load_custom_widgets' ); | |
// Creating the widget | |
class ebook_cat_menu extends WP_Widget { |
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 | |
/* | |
* Change WordPress default gallery output | |
*/ | |
add_filter('post_gallery', 'ct_post_gallery', 10, 2); | |
function ct_post_gallery($output, $attr) { | |
global $post; | |
if (isset($attr['orderby'])) { | |
$attr['orderby'] = sanitize_sql_orderby($attr['orderby']); |