Skip to content

Instantly share code, notes, and snippets.

@timwco
timwco / instructions.md
Last active September 29, 2018 00:23
How to use Bourbon, Neat, Bitters and Refills in a Yeoman app with Bower.

Your bower_components folder should be outside of your /app folder. Otherwise you'll need to modify the paths below.

  • Scaffold your Yeoman App
  • Install Bourbon, Neat & Bitters
    • bower install bourbon
    • bower install neat
    • bower install bitters
  • In your app/stylesheets/main.scss include the assets in this order
@import '../../bower_components/bourbon/dist/bourbon';
@timwco
timwco / directions.md
Last active August 16, 2017 17:51
Deploy Yeoman App on Heroku

Deploy a Yeoman Web App on Heroku

Prerequisites - Heroku Toolbelt

1: Navigate to any Yeoman App

2: You'll need Express and Gzippo so run the following

  • npm install gzippo --save
  • npm install express --save
@timwco
timwco / yeoman-githubpages.md
Last active August 16, 2017 17:48
Yeoman & Github Pages

By default Yeoman puts your final work in a folder called dist which by default is ignored by git.

Also, since the site is not powered from the root of your project, Github Pages will show a Page Not Found.

You need to both tell git to NOT ignore the dist folder as well as set up a subtree for your gh-pages branch.

Here are the steps.

Step 1

@timwco
timwco / gist:9212770
Last active August 29, 2015 13:56
Show/Hide Barley Icon - http://getbarley.com
// Hide the Barley Icon by default
// Show the Barley Icon on ESC Key Press
// Make sure DOM is loaded
document.addEventListener('DOMContentLoaded', function(){
// The Barley Icon Element
var barleybar = document.getElementById('barley-bar');
// Hide By Default
@timwco
timwco / remove_post_by_author.sql
Created April 21, 2012 15:12
Remove All Post & Post Meta By Author - WordPress
DELETE a,b,c FROM `wp_posts` a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_author = '0';
@timwco
timwco / gist:2081620
Created March 18, 2012 21:31 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@timwco
timwco / gist:1685021
Created January 26, 2012 20:50
Adjust Default Tags Widget
<?php
add_filter( 'widget_tag_cloud_args', 'my_widget_tag_cloud_args' );
function my_widget_tag_cloud_args( $args ) {
$args['number'] = 20;
$args['largest'] = 9;
$args['smallest'] = 9;
$args['unit'] = 'px';
$args['exclude'] = array(20, 80);
return $args;
@timwco
timwco / gist:1020229
Created June 11, 2011 03:44
Custom Icon in Wordpress Admin
<?php
function as_custom_logo() {
echo '
<style type="text/css">
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/myIcon.png) !important; }
</style>
';
}
@timwco
timwco / gist:1008959
Created June 5, 2011 13:27
Wordpress Apply to All Sub Pages
<?php
if ( is_page('about-us') || '3' == $post->post_parent ) {
// Do Something SPECIFIC Here
} else {
// Handle Everything Else Here
}
?>