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
'use strict'; | |
module.exports = function(grunt) { | |
// load all grunt tasks matching the `grunt-*` pattern | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
// watch for changes and trigger compass, jshint, uglify and livereload | |
watch: { |
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
'use strict'; | |
module.exports = function(grunt) { | |
// load all grunt tasks matching the `grunt-*` pattern | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
// watch for changes and trigger compass, jshint, uglify and livereload | |
watch: { |
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
Vagrant.configure("2") do |config| | |
config.vm.box = "precise32" | |
config.vm.box_url = "http://files.vagrantup.com/precise32.box" | |
config.vm.network :private_network, ip: "192.168.204.72" | |
config.ssh.forward_agent = true | |
config.vm.provider :virtualbox do |v| | |
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
v.customize ["modifyvm", :id, "--memory", 1024] |
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
// Load plugins | |
var gulp = require('gulp'), | |
plugins = require('gulp-load-plugins')({ camelize: true }), | |
lr = require('tiny-lr'), | |
server = lr(); | |
// Styles | |
gulp.task('styles', function() { | |
return gulp.src('assets/styles/source/*.scss') | |
.pipe(plugins.rubySass({ style: 'expanded', compass: true })) |
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
# Create directory for new site | |
cd ~/Sites | |
mkdir {query} | |
cd {query} | |
# Download latest version of WordPress | |
wp core download | |
# Setup wp-config file with WP_DEBUG enabled | |
wp core config --dbname={query} --dbuser=root --dbpass=root --dbprefix={query}wp_ --extra-php <<PHP |
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 | |
// Get terms | |
// http://codex.wordpress.org/Function_Reference/get_terms | |
// use $args array in second parameter if needed | |
$my_categories = get_terms( 'TERM_NAME_HERE' ); | |
$my_categories_count = count( $my_categories ); | |
if ( $my_categories_count > 0 && is_array( $my_categories ) ) { | |
echo '<div class="wrap">'; |
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 | |
add_filter( 'tiny_mce_before_init', 'mb_unhide_kitchensink' ); | |
function mb_unhide_kitchensink( $args ) { | |
$args['wordpress_adv_hidden'] = false; | |
return $args; | |
} |
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 global $wp_query; | |
query_posts( | |
array_merge( | |
$wp_query->query, | |
array( | |
'orderby' => 'post_date', | |
'order' => 'desc' | |
) | |
) | |
); |
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
// Get any existing copy of our transient data | |
if ( false === ( $%filltext:name=Query Name:default=myquery% = get_transient( '%filltext:name=Query Name:default=myquery%' ) ) ) { | |
// It wasn't there, so regenerate the data and save the transient | |
$%filltext:name=Query Name:default=myquery%_args = array( | |
'post_type' => '%filltext:name=Post Type:default=post%', | |
'order' => '%fillpopup:name=Order:default=ASC:DESC%', | |
'orderby' => '%fillpopup:name=Orderby:default=date:ID:rand:title:author:menu_order%', | |
'post_status' => 'publish', | |
'posts_per_page' => %filltext:name=Posts Per Page:default=-1% |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |