Skip to content

Instantly share code, notes, and snippets.

View nessthehero's full-sized avatar
💭
🍕

Ian Moffitt nessthehero

💭
🍕
View GitHub Profile
@nessthehero
nessthehero / app.js
Created July 17, 2012 16:32
Node Cacher
/**
* Module dependencies.
*/
var express = require('express')
, http = require('http')
, https = require('https')
, config = require('./feeds')
, cache = require('cache');
@nessthehero
nessthehero / qs.js
Last active October 10, 2015 14:47
Get the query string(s)
BREI.data = {};
BREI.data.query = {};
BREI.util = {};
BREI.util.q = function() {
var vars = [],
grabUrl = window.location.search,
parts,
pieces,
qs = '',
qsVals = [];
@nessthehero
nessthehero / Gruntfile.js
Created November 5, 2012 18:55
grunt 0.4 dummy task
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
test: {
options: {
taskSetting: true
},
@nessthehero
nessthehero / README.md
Last active March 27, 2018 14:59
JavaScript Boilerplate

JS Boilerplate

Simple boilerplate I use to start JavaScript projects.

githalytics.com alpha

@nessthehero
nessthehero / microtemplate
Created March 29, 2013 12:09
Micro-Templating
// 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;
@nessthehero
nessthehero / placeholder.js
Created April 9, 2013 17:13
Simple placeholder polyfill
// 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 () {
@nessthehero
nessthehero / Belt.md
Last active December 17, 2015 11:09
Utility belt of awesome, small javascript snippets that I use very often.

Some simple stuff that I use very often in projects.

@nessthehero
nessthehero / placeholderfill.js
Created July 16, 2013 17:28
Placeholder polyfill
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', "");
}
@nessthehero
nessthehero / boilerplate2.js
Last active December 21, 2015 08:58
Boilerplate.js version 2
// 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 () {
@nessthehero
nessthehero / common.css
Last active December 21, 2015 19:18
Common CSS Reset styles
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;