Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar

Wil (₩) Moore III wilmoore

View GitHub Profile
@wilmoore
wilmoore / .vimrc.after
Last active June 17, 2016 00:16
Vim Configuration
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" My Personal Vim Configuration
" Wil Moore III <[email protected]>
"
" I keep this configuration documented here:
" https://gist.github.com/3901161
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""
"" base
@domenic
domenic / promises.md
Last active April 1, 2025 01:54
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@wilmoore
wilmoore / readme.md
Last active February 11, 2024 22:32
UMD-inspired Module Boilerplate

UMD-Inspired JS Module Boilerplate

This is the module format you don't know you need until you need it. Write your module once and have it work in a CJS/NodeJs, AMD, YUI (v3+), or Browser Global environment.

Best Used When...

  • You are migrating from namespaced (err, globals) code to either AMD or CJS modules or both.
  • You can't yet factor out browser globals but also need to test your code via NodeJS (e.g. Mocha).

Benefits & Trade-offs

@wilmoore
wilmoore / readme.md
Created October 11, 2012 18:59
Terminal Tab reflecting your current git project name

First, setup a git alias:

% git config --global alias.project-name 'config --replace-all project.info.name'

Use it like this (your CWD should be a git project):

% git project-name "NodeJS Latest"
@rwaldron
rwaldron / sept-18.md
Created September 28, 2012 00:59
September TC39 Meeting Notes

September 18 2012 Meeting Notes

Rick Hudson (RH), John Neumann (JN), Mark Miller (MM), Norbert Lindenberg (NL), Nebojsa Ciric (NC), Allen Wirfs-Brock (AWB), Istvan Sebastian (IS), Luke Hoban (LH), Paul Leathers (PB), Sam Tobin-Hochstadt (STH), Andreas Rossberg (ARB), Brendan Eich (BE), Erik Arvidsson (EA), Dave Herman (DH), Yehuda Katz (YK), Rick Waldron (RW), Eric Ferraiuolo (EF), Matt Sweeney (MS), Doug Crockford (DC)

Introductions. Brief Agenda tweaks

RW: Confirm that Internationalization spec is available, per last meeting

NL: Internationalization specs are available on the Wiki

@wilmoore
wilmoore / expect-unit.js
Created September 20, 2012 16:20
Wherein we write a naive implementation of a test runner, reporter, and assertion API in order to demonstrate how non-magical testing is.
/**
* How to test:
*
* (1) You provide an expression
* (2) You provide what you "expect" that expression's result/outcome will be
* (3) You express how you'd like to compare "expected" outcome to the actual outcome
* (4) Your test should fail initially because you haven't yet writtne the code to support the positive outcome
* (5) Refactor until the test passes
* (6) Repeat
*/
anonymous
anonymous / gist:3753571
Created September 20, 2012 02:10
@ChristinGorman gave this talk at JavaZone: https://vimeo.com/49484333 It's quite good, short, energetic, enthusiastic,
intelligent, and completely misses the point.
While it's true that the code she produces is much better than the original, and is quite easy to understand; it fails one
critical test. It's not polite.
Polite code is like a well written newspaper article. It allows you to bail out early. A well written article has a
headline, a synopsis, and a set of paragraphs that begin with the high level concepts and get more and more detailed as you
read through the article. At any point you can decide: "I get it! I don't need to read further." Indeed, this is how most
people read newspapers or magazines. The articles are polite, because they allow you to get out quickly.
@wilmoore
wilmoore / sbt-tutorial.md
Created September 19, 2012 07:15
Sbt Tutorial

Starting up sbt

In order to start sbt, open a terminal (“Command Prompt” in Windows) and navigate to the directory of the assignment you are working on. Typing sbt will open the sbt command prompt.

% cd /path/to/progfun-project-directory
% sbt
> _
This is the sbt shell
@wilmoore
wilmoore / filemanager.config.js
Created September 18, 2012 19:12
Sample C5 Filemanager Configuration
// use with: https://github.com/simogeo/Filemanager/pull/97
var
culture = 'en',
defaultViewMode = 'grid',
autoload = true,
showFullPath = false,
displayPathDecorator = function(path) { return path.replace(/^\d+\/images/i, ''); },
browseOnly = false,
lang = 'php',
@wilmoore
wilmoore / merge.js
Created September 17, 2012 17:57
UnderscoreJS-inspired `merge` taking advantage of ES5 where possible
/**
* UnderscoreJS inspired `merge`
* UnderscoreJS calls it `extend` (overloaded in JS); `merge` feels more intention revealing
* This is naive as it always overwrites if the target property exists.
*
* @see https://github.com/documentcloud/underscore/blob/master/underscore.js#L727
* @param {Object} target
* @return {Object} target
*/
function merge(target) {