Skip to content

Instantly share code, notes, and snippets.

View davemo's full-sized avatar
😀

David Mosher davemo

😀
View GitHub Profile

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:

:: 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
// 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);
Customer = function() {
this.orders = [];
this.newOrder = function() {
var o = new Order(1);
this.orders.push(o);
return o;
};
};
Order = function(id) {
@davemo
davemo / hearthstone-card-downloader.js
Last active August 29, 2015 14:08
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']);
function playNotification() {
$('#notification').playNotification();
}
// becomes
function playNotification() {
$(function() {
$("#notification").playNotification();
});
#wrap
+container // using blueprint it gives
#content
+column(16) // 16 grid units wide column
#sidebar
+column(8, true) // 8 units wide, true because it's the last column
// You can write the SASS and the HTML in the same way, using Compass and the Zen-Coding bundle. Prototyping layouts is super quick :)
=horizontal-form(!width)
width = !width
input
float: left
&[type="text"],&[type="select"]
width: 70%
&[type="submit"]
float: right
label
+clearfix
package
{
import com.yahoo.yui.YUIAdapter;
import flash.display.Loader;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
<target name="coverage" depends="clean, copy-coverage-so, copy-index-yaml-static">
<tempfile property="coverage.outfile" destDir="/tmp" />
<!-- Temporarily turns off the USE_I18N in settings.py, re-enabled when coverage has completed -->
<replace file="${srcdir}/settings.py" token="USE_I18N = False" value="USE_I18N = True" />
<!-- see comments in "test" target -->
<exec dir="${srcdir}" executable="python" failonerror="false" resultproperty="coverage.retcode" output="${coverage.outfile}" logError="true">
<env key="UNITTESTS" value="${tests}" />
<env key="PYTHONPATH" value="${test.pythonpath}"/>