Simple boilerplate I use to start JavaScript projects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, http = require('http') | |
, https = require('https') | |
, config = require('./feeds') | |
, cache = require('cache'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BREI.data = {}; | |
BREI.data.query = {}; | |
BREI.util = {}; | |
BREI.util.q = function() { | |
var vars = [], | |
grabUrl = window.location.search, | |
parts, | |
pieces, | |
qs = '', | |
qsVals = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
test: { | |
options: { | |
taskSetting: true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tweet sized templating (the JSLinted version) | |
// http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/ | |
function t(s, d) { | |
var p; | |
for (p in d) { | |
if (d.hasOwnProperty(p)) { | |
s = s.replace(new RegExp('{' + p + '}', 'g'), d[p]); | |
} | |
} | |
return s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires Modernizr | |
if (!Modernizr.input.placeholder) { ph(); } | |
function ph() { | |
$("input[placeholder]:not(.ph)").each(function () { | |
var place = $(this).attr('placeholder'); | |
$(this).attr('value', place); | |
$(this).bind('focus', function () { |
Some simple stuff that I use very often in projects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ph() { | |
$("input[placeholder]:not(.ph), textarea[placeholder]:not(.ph)").each(function () { | |
var place = $(this).attr('placeholder'); | |
$(this).attr('value', place); | |
$(this).bind('focus', function () { | |
if ($.trim($(this).attr('value')) == place) { | |
$(this).attr('value', ""); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Do everything in a closure, so we don't affect or create any globals. | |
(function( $, window, document, undefined ) { | |
"use strict"; | |
var Project = Project || {}; | |
Project.init = function () { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body * { | |
word-break: break-word; | |
word-wrap: break-word; | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
-ms-box-sizing: border-box; | |
box-sizing: border-box; | |
background-color: transparent; |
OlderNewer