(a -> b) -> b -> a
du (T) ( bind (getSpace ('./outer_space.json'))
, map (processSpaces)
| /* Promise.all Implementation | |
| Takes an ordered array of functions that return promises. Returns an ordered array | |
| of the results of all promises only after all promises have completed. | |
| If, at any point, one promise is rejected it will reject with that error. | |
| */ | |
| function promiseAll (promises) { | |
| return new Promise(async (resolve, reject) => { | |
| const indexedPromises = promises.reduce((ps, p, idx) => ({ ...ps, [idx]: p}), {}); |
| #!/bin/bash | |
| CLIENT_ID= # Add client id | |
| CLIENT_SECRET= # Add client secret | |
| AUTH_TOKEN_URL= # Add token url | |
| AUDIENCE= # Add audience | |
| curl --silent --request POST \ | |
| --url $AUTH_TOKEN_URL \ | |
| --header 'content-type: application/json' \ | |
| --data "{\"client_id\":\"$CLIENT_ID\",\"client_secret\":\"$CLIENT_SECRET\",\"audience\":\"$AUDIENCE\",\"grant_type\":\"client_credentials\"}" 2>&1 | \ | |
| grep -Eoi 'ey([^"]+)' | \ |
| var | |
| Slack = require('slack-node'), | |
| T = require ('data.task'), | |
| R = require ('ramda'), | |
| M = require ('control.monads'), | |
| logI = function (x) { console.log (x); return x; }, | |
| id = function (x) { return x; }, | |
| konst = R.curry (function (a, b) { return a; }), | |
| du = function (M) { return function () { return R.apply (R.pipe, arguments)(M.of ({})); }; }, | |
| bind = function (a) { return R.chain (konst (a)); }, |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| npm install -g speed-test gulp nodemon yo |
| 'use strict'; | |
| var util = require('util'), | |
| winston = require('winston'), | |
| logger = new winston.Logger(), | |
| production = (process.env.NODE_ENV || '').toLowerCase() === 'production'; | |
| module.exports = { | |
| middleware: function(req, res, next){ | |
| console.info(req.method, req.url, res.statusCode); |
| <link rel="import" href="../core-icon-button/core-icon-button.html"> | |
| <link rel="import" href="../core-toolbar/core-toolbar.html"> | |
| <link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; |
| <link rel="import" href="../core-scaffold/core-scaffold.html"> | |
| <link rel="import" href="../core-header-panel/core-header-panel.html"> | |
| <link rel="import" href="../core-menu/core-menu.html"> | |
| <link rel="import" href="../core-item/core-item.html"> | |
| <link rel="import" href="../core-icon-button/core-icon-button.html"> | |
| <link rel="import" href="../core-toolbar/core-toolbar.html"> | |
| <link rel="import" href="../core-field/core-field.html"> | |
| <link rel="import" href="../core-icon/core-icon.html"> | |
| <link rel="import" href="../core-input/core-input.html"> | |
| <link rel="import" href="../core-icons/core-icons.html"> |
| $query = DB::select(DB::expr('person.homeid, home.addressid, person.personid, person.firstName, person.middleName, person.lastName, person.gender, person.maritalStatus, person.birth')) | |
| ->from(DB::expr('home, person')) | |
| ->where(DB::expr('home.homeid'), DB::expr('person.homeid')) | |
| ->and_where(DB::expr('person.homeid'), $homeid); | |
| $people = Person::query() | |
| ->related('homes') | |
| ->get(); | |
| // list people's addresses |