Skip to content

Instantly share code, notes, and snippets.


David Mosher davemo

View GitHub Profile
davemo / login.emmet
Last active Jan 12, 2016
A mythical language that doesn't exist, that is whitespace aware emmet/zencoding
View login.emmet
input[type=text name=username placeholder=username ng-model=credentials.username required]
input[type=password name=password placeholder=password ng-model=credentials.password required]
davemo /
Last active Aug 28, 2019

Ottawa JS, February 11, 2015

Your best advice for people getting started in JavaScript:


The Other Simon:

davemo / hearthstone-card-downloader.js
Last active Aug 29, 2015
View hearthstone-card-downloader.js
var fs = require('fs');
var request = require('request');
var download = function(uri, filename, callback){
request.head(uri, function(err, res, body){
console.log('content-type:', res.headers['content-type']);
console.log('content-length:', res.headers['content-length']);
View fluent.js
Customer = function() {
this.orders = [];
this.newOrder = function() {
var o = new Order(1);
return o;
Order = function(id) {
View exercises.js
// Define a function greaterThan(n), that takes a value and returns a predicate
// which returns truthy if that value is greater than n.
var greaterThan = function(n) {
return function(value) {
return value > n;
var greaterThanFour = greaterThan(4);
View add urlacl.cmd
:: NOTE needs to be elevated
@set /p HTTP_PORT=Enter Port number [e.g. 10082]:
netsh http add urlacl url=http://*:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://localhost:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%.local:%HTTP_PORT%/ user=everyone

Keybase proof

I hereby claim:

  • I am davemo on github.
  • I am dmosher ( on keybase.
  • I have a public key whose fingerprint is 6F2F 6F48 0EC7 52E2 53BC 9D4F 7C7C 5A41 C6BC A722

To claim this, I am signing this object:

davemo /
Last active Mar 25, 2020
Got a .coffee file with JSX? Here's how you can transpile to .js with Reacts JSX parsed.
`/** @jsx React.DOM */`
converter = new Showdown.converter
Comment = React.createClass
render: ->
rawMarkup = converter.makeHtml @props.children.toString()
`<div className="comment">
<h2 className="comment">{}</h2>
<span dangerouslySetInnerHTML={{__html: rawMarkup}} />
davemo /
Last active Sep 15, 2016
A .coffee file with Reacts JSX, compiles fine in Sublime Text using 'Coffee: Display JavaScript', but won't compile with the coffeescript CLI or the coffeeify transform for browserify. Relevant reading: and!msg/reactjs/NHy6UNqm-zU/i6Xr0-jP7nIJ
`/** @jsx React.DOM */`
React = require("react")
$ = require("jquery-browserify")
converter = new Showdown.converter
Comment = React.createClass
render: ->
rawMarkup = converter.makeHtml @props.children.toString()
davemo / npm-shrinkwrap-dev-good-0.14.5.json
Created Nov 2, 2013
shrinkwrap --dev, known working good with lineman 0.14.5
View npm-shrinkwrap-dev-good-0.14.5.json
"name": "shopify",
"version": "2.0.0",
"dependencies": {
"grunt": {
"version": "0.4.1",
"from": "grunt@0.4.1",
"dependencies": {
"async": {
"version": "0.1.22",