require 'sinatra' (1)
get '/hi' do (2) (3)
"Hello World!"
end
-
Library import
-
URL mapping
require 'sinatra' (1)
get '/hi' do (2) (3)
"Hello World!"
end
Library import
URL mapping
let fs = require('fs'); | |
let archiver = require('archiver'); | |
let request = require('request'); | |
let archive = archiver('zip', { store: true}); | |
let out = fs.createWriteStream(__dirname + '/sports.zip'); | |
let sport1 = request('http://lorempixel.com/400/200/sports/1/'); | |
let sport2 = request('http://lorempixel.com/400/200/sports/2/'); |
const fs = require('fs'); | |
const selenium = require('selenium-standalone'); | |
const webdriver = require('webdriverio'); | |
installSelenium() | |
.then(startSelenium) | |
.then(runTest) | |
.then(stopSelenium); | |
function installSelenium() { |
function Module(lodash, THREE, moment) { | |
this.thingy = stuff => lodash.zip(stuff, false); | |
this.majig = whatever => moment().format(whatever); | |
this.zxzzxz = blah => new THREE.TextureLoader().load(blah); | |
} | |
module.exports = new Module( | |
require('lodash'), | |
require('three'), | |
require('moment') |
'use strict'; | |
module.exports = function compileJS(grunt) { | |
const babel = require('babel-core'), | |
Concat = require('concat-with-sourcemaps'), | |
config = grunt.config.get('tt'), | |
configHelper = require('../tt/config.js'), | |
fileSeparator = ';\n', | |
fs = require('fs'), | |
path = config.get('dir.public') + '/js', |
var myFileName = 'commercial.js'; | |
var fs = require('fs'); | |
var input = fs.createReadStream(myFileName); | |
var text = ''; | |
input.on('data', function (data) { | |
text += data; | |
}); |
layout | title | date | comments | categories | ||
---|---|---|---|---|---|---|
post |
The gist of monads |
2016-04-07 00:47:16 +0100 |
true |
|
Most monad tutorials are long, confusing, and ineffective. I cannot promise this one will be more clear, more interesting, or even more effective, but I can at least promise to make it brisk. You have nothing to lose by reading it.
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; |