Skip to content

Instantly share code, notes, and snippets.

@pixelcoder
pixelcoder / mixture.json
Created April 16, 2015 10:50
Mixture: Specify output directory.
{
"preprocessorLocations": [
"resource/scss",
"resource/js",
"resource/processed"
],
}
@pixelcoder
pixelcoder / httpd-vhosts.conf
Created April 16, 2015 10:52
Virtual Host: Create new domain alias.
<VirtualHost *:80>
DocumentRoot "c:/path/to/siteroot"
ServerName custom.domain
</VirtualHost>
@pixelcoder
pixelcoder / _defs.scss
Created April 16, 2015 11:04
SCSS: Definitions
$default_colour: #2b2b2b;
$primary_colour: #e14d43;
$secondary_colour: #0074a2;
$info_colour: #fbf5da;
$success_colour: #ebfeeb;
$error_colour: #fef1f0;
$primary_font_stack_regular: 'opensansregular', sans-serif;
$primary_font_stack_italic: 'opensansregularitalic', sans-serif;
$primary_font_stack_bold: 'opensansbold', sans-serif;
@pixelcoder
pixelcoder / template-name.php
Created April 16, 2015 11:23
WordPress custom template.
<?php
/*
TEMPLATE NAME: Name
*/
?>
<?php get_header(); ?>
<?php get_footer(); ?>
@pixelcoder
pixelcoder / _media.scss
Created April 16, 2015 14:01
@media Simple breakpoints.
@media screen and (max-width: 1417px){
}
@media screen and (max-width: 950px){
}
@media screen and (max-width: 550px){
@pixelcoder
pixelcoder / app.js
Created April 16, 2015 14:02
Initialise Flexslider
$flexOpts = {
'animation': 'slide',
'directionNav': false,
'smoothHeight': true
}
$('div.flexslider').flexslider($flexOpts);
@pixelcoder
pixelcoder / app.js
Created April 16, 2015 14:03
jQuery: Animated scroll to top
$('li.page-top a').delegate($(this), 'click', function(e){
e.preventDefault();
$('body, html').animate({
scrollTop: 0
}, 800);
});
@pixelcoder
pixelcoder / app.js
Created April 16, 2015 14:04
jQuery: Toggle sidebar widgets
$('a.toggle-widgets').delegate($(this), 'click', function(e){
e.preventDefault();
$('div.widgets').slideToggle();
});
@pixelcoder
pixelcoder / index.php
Created April 20, 2015 03:42
WordPress: Get sticky posts
<?php
$sticky = get_option('sticky_posts');
$args = array(
'posts_per_page' => 6,
'post__in' => $sticky
);
$px_query = new WP_Query($args);
?>
<?php if(!empty($sticky)) : ?>
<?php while($px_query->have_posts()) : $px_query->the_post(); ?>
@pixelcoder
pixelcoder / init.php
Created April 20, 2015 03:44
WordPress: Get rid of wp_head() junk
# Remove junk
function px_wp_remove_head() {
remove_action('wp_head', 'feed_links');
remove_action('wp_head', 'feed_links_extra');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
remove_action('wp_head', 'locale_stylesheet');
remove_action('wp_head', 'noindex');
remove_action('wp_head', 'wp_print_styles');