Skip to content

Instantly share code, notes, and snippets.

@davemo
davemo / hearthstone-card-downloader.js
Last active Aug 29, 2015
hearthstone-card-downloader.js
View hearthstone-card-downloader.js
#!/usr/local/bin/node
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);
this.orders.push(o);
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
@pause
View keybase.md

Keybase proof

I hereby claim:

  • I am davemo on github.
  • I am dmosher (https://keybase.io/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
davemo / app.coffee
Last active Mar 25, 2020
Got a .coffee file with JSX? Here's how you can transpile to .js with Reacts JSX parsed.
View app.coffee
`/** @jsx React.DOM */`
converter = new Showdown.converter
Comment = React.createClass
render: ->
rawMarkup = converter.makeHtml @props.children.toString()
`<div className="comment">
<h2 className="comment">{this.props.author}</h2>
<span dangerouslySetInnerHTML={{__html: rawMarkup}} />
@davemo
davemo / app.coffee
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: http://blog.vjeux.com/2013/javascript/react-coffeescript.html and https://groups.google.com/forum/#!msg/reactjs/NHy6UNqm-zU/i6Xr0-jP7nIJ
View app.coffee
`/** @jsx React.DOM */`
React = require("react")
$ = require("jquery-browserify")
converter = new Showdown.converter
Comment = React.createClass
render: ->
rawMarkup = converter.makeHtml @props.children.toString()
@davemo
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",
View npm-shrinkwrap.json
{
"name": "shopify",
"version": "2.0.0",
"dependencies": {
"grunt": {
"version": "0.4.1",
"from": "grunt@0.4.1",
"dependencies": {
"async": {
"version": "0.1.22",
@davemo
davemo / config.coffee
Last active Dec 27, 2015
wip directory watcher
View config.coffee
# Exports an object that defines
# * all of the configuration needed by the projects'
# * depended-on grunt tasks.
# *
# * You can find the original parent object in: node_modules/lineman/config/application.coffee
path = require "path"
grunt = require "grunt"
# additional grunt plugins
You can’t perform that action at this time.