Skip to content

Instantly share code, notes, and snippets.

View say2joe's full-sized avatar
🏠
Codifying my code; possibly refactoring!

Joseph J. Johnson say2joe

🏠
Codifying my code; possibly refactoring!
View GitHub Profile
@say2joe
say2joe / r4a.js
Last active October 11, 2015 18:48
R4A: Utilizes messaging, modals, native error object, cookies, etc.
/**
* T*****: Racing For Awareness Contest and Sweepstakes.
* @author Joe Johnson (joe.johnson@icrossing.com)
* @requires jQuery
* @namespace
*/
var R4A = {
hasContestEnded: true,
Shirts: {}, places: [],
sweepstakes: "forms.html",
@say2joe
say2joe / app.js
Last active October 11, 2015 18:27
JS App /w JSON Image Data
/**
* @namespace
* TCR (<masked>) is a global namespace object containing
* the methods and properties used throughout this application.
* @requires jQuery-1.8.2 and Portfolio.JS (and its dependencies).
*/
var TCR = {
Data: { Images: $() },
Images: { Slideshow: [], Gallery: [] },
initSlideshow: function(){
@say2joe
say2joe / slp.codes.js
Last active October 11, 2015 09:58
Sample JS App Template (JavaScript)
/**
* SLP.Modules.Codes extends the SLP.Modules object on DOM-ready.
* @module Codes
*/
SLP.Modules.Codes = {
/**
* First validate for empty fields, then check the campaign codes,
* making sure that they begin with T(masked), L(masked), or S(masked).
* @param {object} event jQuery Event object (form submit)
* @return {boolean} true if all validation passes.
@say2joe
say2joe / grunt.js
Created October 5, 2012 18:22
Sample Grunt Task (JavaScript)
module.exports = function(grunt) {
grunt.initConfig({
min: {
plugins: {
src: ["vendor/jquery.isotope.min.js","vendor/plugins.js","vendor/modal.js","vendor/jqpp.js"],
dest: "dist/plugins.min.js",
separator: ';'
},
app: {
@say2joe
say2joe / RWD-HD-IMG.js
Created October 5, 2012 17:16
Render Hi-Res IMGs for Retina Displays (JavaScript)
/**
* Retina image update script. Invoke with Retina.render().
* Retina.render() may be passed a selector for img selection.
* The default filter looks for imgs with data-scale="retina".
* @param {string|function} expr A CSS selector expression or jQuery filter function.
* @return {boolean|collection} Returns false or (for Retina displays) the images updated.
* @author Joe Johnson (joe.johnson@icrossing.com)
*/
(function(ns,$){
ns.Retina = {
@say2joe
say2joe / PrototypeChain.js
Created January 26, 2015 19:06
JS Object Prototype Augmentation (JS helper methods)
if (![].unique) {
Array.prototype.unique = function() {
var n = {}, r = [], i = 0, l = this.length;
for (; i < l; i++) {
if (this[i] && !n[this[i]]) {
n[this[i]] = true;
r.push(this[i]);
}
}
return r;
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@say2joe
say2joe / si.js
Created October 18, 2014 07:30
Sorting and intersection
MS = Sharecize = {
d3: d3,
DOM: {
$view: $('#MS-container'),
$content: $('section#content'),
$console: $('aside#console > div')
},
Writer: function (DOM) {
if (!DOM) DOM = Sharecize.DOM.$content;
if (!DOM.jquery) DOM = $(DOM);
@say2joe
say2joe / index.html
Created September 2, 2014 22:53
A Pen by Joe Johnson.
<form>
<input name="username" placeholder="username" />
<input name="password" type="password" placeholder="password" />
</form>