Skip to content

Instantly share code, notes, and snippets.

View JohnLauber's full-sized avatar

John Lauber JohnLauber

View GitHub Profile
@JohnLauber
JohnLauber / My BrowserSync Gruntfile Settings
Last active August 29, 2015 14:13
My GruntFile.js setup for BrowserSync. I turn off ghost mode for independent play on various devices. Also since I had issues with iPhone connecting to my server I added a named tunnel.
browserSync: {
dev: {
bsFiles: {
src : 'style.css'
},
options: {
proxy: "local.testing.dev",
ghostmode: false,
port: 8080,
tunnel: "testing", // < Used for iPhone testing
@JohnLauber
JohnLauber / BrowserSync Install
Created January 14, 2015 22:57
Installing BrowserSync into a Grunt Project
npm install grunt-browser-sync --save-dev
@JohnLauber
JohnLauber / Add current menu item to archive page
Last active August 29, 2015 14:13
Filter to add current-menu-item to menu on page load. The class does not get added to pages used as an archive. This is the solution, so you can get your active/hover ability back. You'll need to know the ID of the menu item which you can grab from developer's tools.
/*****
This gets placed in your functions.php file of your theme.
Change the menu-item-# to your specific menu class identifier
***********/
add_filter('nav_menu_css_class', 'special_nav_class', 10, 2);
function special_nav_class($classes, $item) {
if (in_array('menu-item-#', $classes)) {
$classes[] = 'current-menu-item current_page_item';
}
@JohnLauber
JohnLauber / Enqueue And Load Isotope
Last active August 29, 2015 14:11
Enqueue and Load Isotope
/* Setup Isotope in functions.php*/
function add_isotope() {
wp_register_script('isotope', get_stylesheet_directory_uri() . '/assets/js/isotope.pkgd.min.js', array('jquery'), true);
wp_register_script('isotope-init', get_stylesheet_directory_uri() . '/assets/js/the-isotope.js', array('jquery', 'isotope'), true);
wp_enqueue_script('isotope-init');
}
add_action('wp_enqueue_scripts', 'add_isotope');
/* JS code that uses isotope (file name 'the-isotope.js' above) */
@JohnLauber
JohnLauber / Date-Issue
Created March 20, 2014 16:06
Date Issue
global $post;
$the_skills = get_post_meta($post->ID, 'necessary_skills', true);
$location = get_post_meta($post->ID, 'location', true);
$pdate = the_time('m/j/Y');
echo '<li><i class="fa fa-map-marker"></i> '. $location .'</li>';
echo '<li><i class="fa fa-calendar"></i> Posted on '. $pdate .'</li>';
echo '<li><i class="fa fa-pencil"></i> '. $the_skills .'</li>';

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post