Skip to content

Instantly share code, notes, and snippets.

View stuartweir's full-sized avatar

Stu Weir stuartweir

View GitHub Profile
@stuartweir
stuartweir / header.php
Last active August 29, 2015 14:17
Creating a responsive `wp_nav_menu` in WordPress
// inside of header.php
<div class='menu_bg'>
<?php wp_nav_menu( array( 'theme_location'=>'main', 'menu_class' => 'menu', 'depth' => 1)); ?>
</div>
@stuartweir
stuartweir / Frontend Masters - JS the good parts
Created February 26, 2015 00:12
Learning about functional programming, inheritance, etc
// Write a function that takes an argument and
// returns that argument.
function identity(id) {
return id;
}
// Write two binary functions, 'add' and 'mul',
// that take two numbers and return their sum and product.