I hereby claim:
- I am thedahv on github.
- I am thedahv (https://keybase.io/thedahv) on keybase.
- I have a public key ASCW6Esb-WTGH3uL7pDZRhrg6-PwRYlADu73U8F1Top4OAo
To claim this, I am signing this object:
| type t; | |
| [@bs.module] external make: string => t = "compromise"; | |
| module Extraction = { | |
| /* return an array of meta-data for the adjectives and their adverbs */ | |
| [@bs.send] external adjectives: t => t = "adjectives"; | |
| /* return an array of meta-data for the adverbs in this text */ | |
| [@bs.send] external adverbs: t => t = "adverbs"; |
| license: mit |
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * This example tries to show how a one-way state flow control library--similar | |
| * to libraries like Redux, Flow, Elm, etc.--could work. For a quick refresher | |
| * on the problem we're solving, we want a way to: | |
| * | |
| * - make the state of our app easier to find and express | |
| * - confine changes to our state to clear, simple, pure functions | |
| * - update the app in response to events--either from the user or from the | |
| * browser | |
| * |
| /** | |
| * A silly little snippet to get #MozTheMonster out from under your bed and | |
| * hiding under the source code of your web page. | |
| * | |
| * For devs reading this to evaluate and/or learn JS, please don't follow this | |
| * style. It is not meant to be readable nor maintainable, and I would handily | |
| * reject this kind of code in my professional contexts. It takes a *bunch* of | |
| * hacks and shortcuts to keep code small (I was originally challenging myself | |
| * to fit it into a Tweet...not gonna happen). | |
| * |
| type alias Content = | |
| { title : String | |
| , copy : String | |
| , children : Children | |
| } | |
| type Children | |
| = Children (List Content) |
| if ENV['RACK_ENV'] == 'development' | |
| # Connect to development db | |
| elsif ENV['RACK_ENV'] == 'test' | |
| # Connect to test db | |
| else | |
| # Last case. Connect to production | |
| end | |
| ## Example using case statement | |
| switch ENV['RACK_ENV'] |
| namespace FSharpTemplate | |
| module Template = | |
| type HtmlElement = | |
| | Html of HtmlElement list | |
| | Head of HtmlElement list | |
| | Title of string | |
| | Body of HtmlElement list | |
| (* id, class, children *) | |
| | Div of string * string * HtmlElement list |
| # node -v => v0.6.13 | |
| # npm -v => 1.1.9 | |
| # python (IronPython) -v => IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.17379 | |
| PS C:\Applications\node\js-browser-automation> npm install jsdom | |
| npm http GET https://registry.npmjs.org/jsdom | |
| npm http 304 https://registry.npmjs.org/jsdom | |
| npm http GET https://registry.npmjs.org/cssom | |
| npm http GET https://registry.npmjs.org/contextify | |
| npm http GET https://registry.npmjs.org/request |
| // wrapped in anonymous function to protect against | |
| // leaks to global NS | |
| (function () { | |
| // Factory to create objects | |
| var make_thing = function (initial_value) { | |
| var thing = that = {}; | |
| thing.value = initial_value; | |
| thing.dosomething = function () { | |
| return that.value; // 'that' is 'closed over' |