Skip to content

Instantly share code, notes, and snippets.

View brianfeister's full-sized avatar
🧙‍♂️

Brian Feister brianfeister

🧙‍♂️
View GitHub Profile
@brianfeister
brianfeister / wp-bootstrap-walker-class.php
Created July 19, 2012 16:18 — forked from isGabe/wp-bootstrap-walker-class.php
Extended Walker Class for Twitter Bootsrap Navigation Wordpress Integration
<?php
class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl( &$output, $depth ) {
//In a child UL, add the 'dropdown-menu' class
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"dropdown-menu\">\n";
@brianfeister
brianfeister / Bootstrap Sub-theme Engine Vars
Last active October 12, 2015 12:37
Per-theme variable declarations for sub-theming engine for via Twitter Bootstrap
// --------------------------------------------------
//
// SUB-THEME-SPECIFIC VARIABLES
//
// --------------------------------------------------
// Home
// -------------------------
@home-sub-theme-PrimaryColor: @primaryColor;
@home-sub-theme-AccentColor: @accentColor;
@brianfeister
brianfeister / attach_heads.js
Created December 15, 2012 13:04
Sub-theming engine for Grunt.js + Roots Theme + Twitter Bootstrap
/**
* Task: attach_heads
* Description: Set the heads for all themes declared in themes.json
*/
module.exports = function(grunt) {
'use strict';
var fs = require('fs');
var path = require('path');
@brianfeister
brianfeister / gist:4640642
Last active December 11, 2015 18:19
Function for custom display of Timely All-in-One-Calendar long date
/* ========================================================================================
*
* function for custom date range display of Timely ai1ec events
*
* @param $event - you must pass Timely's $event object to this function
* @param $date_format - pass a PHP valid date format for Month & Day (not year!)
* @param $time_format - pass a PHP valid time format, pass FALSE to omit time from output
* @param $echo - defaults to true, in order to return pass FALSE for $echo parameter
* ======================================================================================== */
@brianfeister
brianfeister / Bootstrap Sub-theme Engine Function
Last active December 16, 2015 02:48
Bootstrap Sub-theme Iterating Function
//
// Mixins to build sub-themes
// --------------------------------------------------
// call this to build a new theme and create all needed variables in _sub-themes.less
.setThemeColors( @themeName ) {
(~"body.@{themeName}") {
color: ~"@{@{themeName}-PrimarySubdued}";
background-color: ~"@{@{themeName}-AccentColor}";
a {
@brianfeister
brianfeister / constrained_popover.js
Last active December 16, 2015 02:49
Constrained popover to extend Bootstrap popover and make it intelligently switch orientation based on relative position of popup to container
if ( ! $.fn.constrained_popover ) {
// Constrained popover allows you to pass any DOM element in jQuery syntax and get a
// Bootstrap popover that changes orientation based on it's proximity to the container bounds
/* CONSTRAINED_POPOVER PUBLIC CLASS DEFINITION
* =========================================== */
var ConstrainedPopover = function ( element, options ) {
this.init('constrained_popover', element, options )
@brianfeister
brianfeister / constrained_popover_handlers.js
Created April 11, 2013 17:35
Handle various uses of constrained popover plugin
define( [
"jquery"
],
function( $ ) {
"use strict"; // jshint ;_;
/**
* Handler for popover trigger: mouseenter.
*
* @param {object} e JS event object
//assume that Backbone and $ are available as globals
//everything in this file will be interpretted as soon as the JS is
//loaded by the browser.
var MainRouter = require('./2-mainRouter'); //A Backbone Router
//doc ready
$(function () {
router = new MainRouter();
@brianfeister
brianfeister / app.js
Created June 19, 2013 23:08
Marionette App Definition
this.theAppName = (function(Backbone, Marionette) {
var App;
App = new Marionette.Application;
App.addRegions({
headerRegion: "#header-region"
});
@brianfeister
brianfeister / phone-country-formats
Created November 24, 2013 00:42
Phone Codes & Formats By Country ISO code
var BFHPhoneFormatList = {
'AF': '+93 0dd ddd dddd',
'AL': '+355 0dd ddd ddd',
'DZ': '+213 0ddd dd dd dd',
'AS': '+1 (ddd) ddd-dddd',
'AD': '+376 ddddddddd',
'AO': '+244 ddd ddd ddd',
'AI': '+1 (ddd) ddd-dddd',
'AQ': '+672 ddddddddd',
'AG': '+1 (ddd) ddd-dddd',