Inspired by Literate CoffeeScript.
$ cat hello.rb.md
Here's a simple program
puts "Hello, world"
$ ruby litrb.rb < hello.rb.md
Hello, world
Inspired by Literate CoffeeScript.
$ cat hello.rb.md
Here's a simple program
puts "Hello, world"
$ ruby litrb.rb < hello.rb.md
Hello, world
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
// This is a slightly modified version of two patches. The first suggested at | |
// http://stackoverflow.com/questions/5802461/javascript-which-browsers-support-parsing-of-iso-8601-date-string-with-date-par | |
// and the second, for Date.js suggested at | |
// http://stackoverflow.com/questions/12145437/date-js-parsing-an-iso-8601-utc-date-incorrectly | |
// | |
// Here we override the implementation of Date.parse provided by Date.js. In this implementation we | |
// first check to see if we can construct the date using the Date constructor. If we can, we move | |
// along. If we cannot, we attempt to start the Date.js grammar parser. If that, too, fails us, we | |
// then assume we're running in IE 8, and someone passed in an ISO8601 string, which IE8's date | |
// constructor won't recognize. So we try to manually parse it out, returning a Date instance. |