Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar

Wil (₩) Moore III wilmoore

View GitHub Profile
@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 / 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"
@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

@domenic
domenic / promises.md
Last active May 13, 2026 13:10
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 / .vimrc.after
Last active June 17, 2016 00:16
Vim Configuration
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" My Personal Vim Configuration
" Wil Moore III <wil.moore@wilmoore.com>
"
" I keep this configuration documented here:
" https://gist.github.com/3901161
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""
"" base
@wilmoore
wilmoore / 01_filter_sort.php
Last active October 12, 2015 03:58
Filter and Sort (least concise and enjoyable to write from the top, to the most concise and enjoyable at the bottom)
<?php
$fields = array('firstName', 'middleName', 'lastName', 'suffix');
$names[] = array('firstName' => 'Diane ', 'middleName' => 'Tanya ', 'lastName' => ' Douglas', 'suffix' => '');
$names[] = array('firstName' => 'Jon ', 'middleName' => '', 'lastName' => ' Watson', 'suffix' => '');
$names[] = array('firstName' => ' Michelle ', 'middleName' => '', 'lastName' => ' Ajuria', 'suffix' => '');
$names[] = array('firstName' => 'Elliot ', 'middleName' => '', 'lastName' => 'Gray ', 'suffix' => 'II');
$names[] = array('firstName' => ' Jason ', 'middleName' => '', 'lastName' => 'Doran', 'suffix' => '');
// drop superfluous spaces and empty name parts (i.e. if there is no middle name, get rid of it)
$names = array_map(function($name) {
@wilmoore
wilmoore / icon-codes.md
Created December 6, 2012 19:11
Github Comment Icon Codes (Markdown)

👍:+1:

👎:-1:

💯:100:

🔢:1234:

🎱:8ball:

#!/bin/sh
#
# Usage: git semver-tags [-p|--pre]
#
# Lists semver tags in the repository in order from newest to oldest.
#
# Useful for e.g. programmatically finding the latest release tag:
# `git semver-tags | head -n 1`.
#
# Tag names must be valid according to the SemVer 1.0.0 specification
@asciidisco
asciidisco / getTitle.js
Created January 31, 2013 16:19
Access PhantomJS via WebDriver/JSONWireProtocol from node to receive the title of a webpage
// before you launch this script, make sure you have phantomjs v1.8 installed
// and launch it with the port specified in the options: ´$ phantomjs --webdriver=3456´
var http = require('http');
// request body for "/wd/hub/session" request
var body = JSON.stringify({desiredCapabilities: {browserName: 'firefox', version: '', platform: 'ANY'}});
// base options for post requests
var options = {
@creationix
creationix / hidepatch.js
Created March 20, 2013 16:24
Idea to make private properties and methods non-enumerable instead of prefixing them with underscores (in ES5 and above environments of course)
Object.defineProperty(Object.prototype, "hide", {
value: function () {
[].forEach.call(arguments, function (name) {
var descriptor = Object.getOwnPropertyDescriptor(this, name);
if (descriptor.enumerable) {
descriptor.enumerable = false;
Object.defineProperty(this, name, descriptor);
}
}, this);
}