Skip to content

Instantly share code, notes, and snippets.

View smeranda's full-sized avatar

Seth Meranda smeranda

View GitHub Profile
@benw
benw / load-hbs-partials.js
Created October 3, 2012 00:29
Loads partial handlebars templates from files in a directory
// Helps with this problem:
// http://stackoverflow.com/questions/8059914/express-js-hbs-module-register-partials-from-hbs-file
var hbs = require('hbs');
var fs = require('fs');
var partialsDir = __dirname + '/../views/partials';
var filenames = fs.readdirSync(partialsDir);
@smeranda
smeranda / UNL WDN Templates v3.1 CSS Media Queries
Created March 13, 2012 04:16
UNL WDN Templates v3.1 CSS Media Queries
/* UNL WDN Templates
v3.1 CSS Media Queries */
@media (min-width: 320px) {
}
@media (min-width: 480px) {
}
@media (min-width: 600px) {
@smeranda
smeranda / unl_mq.less
Last active September 29, 2015 09:58
Use similar breakpoints to new WDN grid variables. Streamline so dependency is only on the set variable.
/*
*
* !DO NOT EDIT THE CSS FILES, THEY ARE BUILT WITH THE LESS CSS!
* less/dir/file.less
*
* ---------------------------
* Styles associated with the XYZ
* ---------------------------
*/
@import "../_mixins/all.less";
@strathmeyer
strathmeyer / handlebars.object_helpers.js
Created November 16, 2011 21:57
Handlebars.js helpers to iterate over objects
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, fn) {
var buffer = "",
key;
@westonruter
westonruter / media-fragments-for-media-elements.user.js
Created November 14, 2010 09:47
User script to add support for Media Fragment time offsets (e.g. #t=20) to standalone HTML5 media elements.
// ==UserScript==
// @name Media Fragments for Media Elements
// @description Adds support for Media Fragment time offsets (e.g. #t=20) to standalone HTML5 media elements (i.e. audio, video); allows you to bookmark time indexes by in media (via pausing) and then navigate between them with browser navigation.
// @namespace http://weston.ruter.net/
// @include *
// ==/UserScript==
/**
* Issues or potential issues:
* - If currentTime gets set too soon (before media initializes) does an error occur?