Skip to content

Instantly share code, notes, and snippets.

Avatar

Seth Meranda smeranda

  • Concordia University, Nebraska; Ruffalo Noel Levitz
  • Lincoln, NE
View GitHub Profile
@benw
benw / load-hbs-partials.js
Created Oct 3, 2012
Loads partial handlebars templates from files in a directory
View load-hbs-partials.js
// 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 Mar 13, 2012
UNL WDN Templates v3.1 CSS Media Queries
View 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 Sep 29, 2015
Use similar breakpoints to new WDN grid variables. Streamline so dependency is only on the set variable.
View unl_mq.less
/*
*
* !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 Nov 16, 2011
Handlebars.js helpers to iterate over objects
View handlebars.object_helpers.js
// 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;
View CSS3 Media Queries Template
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
@westonruter
westonruter / media-fragments-for-media-elements.user.js
Created Nov 14, 2010
User script to add support for Media Fragment time offsets (e.g. #t=20) to standalone HTML5 media elements.
View media-fragments-for-media-elements.user.js
// ==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?