Skip to content

Instantly share code, notes, and snippets.

View jcreamer898's full-sized avatar
🏠
Working from home

Jonathan Creamer jcreamer898

🏠
Working from home
View GitHub Profile
@nzakas
nzakas / simplemap.js
Created April 3, 2014 17:38
A simple map implementation for JavaScript (not intended to be an ES6 polyfill)
function SimpleMap() {
this._data = {};
}
SimpleMap.prototype = {
get: function(key) {
return this.has(key) ? this._data[key] : null;
},
call pathogen#infect()
call dirsettings#Install()
" We use a vim
set nocompatible
" Colo(u)red or not colo(u)red
" If you want color you should set this to true
let color = "true"
@emjayess
emjayess / qunit-boilerplate-markup.html
Created May 11, 2011 19:13
QUnit boilerplate markup
<!DOCTYPE html>
<html>
<head>
<title>javascript unit tests...</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css"/>
</head>
<body>
<h1 id="qunit-header">QUnit Sample</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
@eliperelman
eliperelman / example.js
Last active September 26, 2015 08:08
Guaranteed Instances
var Car = function(make, model, color) {
this.make = make;
this.model = model;
this.color = color;
};
// This way works:
var pinto = new Car('ford', 'pinto', 'green');
// but this doesn't:
var pinto = Car('ford', 'pinto', 'green');
@jcreamer898
jcreamer898 / gist:1591029
Created January 10, 2012 20:34
Javascript Standards and Patterns

From Javascript Web Applications by Alex MacCaw,

"The secret to making large JavaScript applications is not to make large JavaScript applications. Instead, you should decouple your application into a series of fairly independent components. The mistake developers often make is creating applications with a lot of interdepenency, with huge linear JavaScript files generating a slew of HTML tags. These sorts of applications are difficult to maintain and extend, so they should be avoided at all costs. Paying a bit of attention to an applications structure when you start building it can make a big difference to the end result. Ignore any preconceived notions you have about JavaScript and treat it like the object-oriented language that it is. Use classes, ineritance, objects, and patterns in the same way you would if you were building an application in another language such as Python or Ruby. Architecture is critical to server-side applications, so why shouldn't the same apply to client-side apps."

Our applic

@evo42
evo42 / aloha-editor-requirejs.html
Created February 16, 2012 16:28
Using Aloha Editor as RequireJS module /
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Load Aloha Editor with require.js</title>
<!-- load the jQuery and require.js libraries -->
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.2.js"></script>
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
@elijahmanor
elijahmanor / images.md
Created January 18, 2013 20:54
Random Images

Animated Gifs

@michaelfairley
michaelfairley / bowling.erl
Last active December 20, 2015 03:29
Erlang bowling kata
-module(bowling).
-export([main/1]).
main(_) ->
test().
test() ->
% empty
[] = score([]),
% boring
anonymous
anonymous / ModelDebugHelper.cs
Created December 23, 2013 15:59
@using System.Reflection
@helper DumpModel(dynamic obj) {
var uuid = string.Format("dump-model-table-{0}", Guid.NewGuid().ToString("N"));
<style>
.-dumped-model-table,
.-dumped-model-table > caption {
font-size: 11px;
}
@elijahmanor
elijahmanor / readme.md
Created January 23, 2014 17:48
Twitter Tech Search

from:jsgoodies OR from:javascriptdaily OR from:jscentral OR from:functionsource OR from:echojs OR from:aspnet OR from:techdotpro OR from:html5weekly