##Theorem:
Given fmap id = id
:
fmap f . fmap g = fmap (f . g)
To prove this we're going to need a few lemmas:
package daos | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future | |
import play.api.Play.current | |
import play.modules.reactivemongo._ | |
import reactivemongo.api._ | |
import reactivemongo.api.indexes._ | |
import reactivemongo.bson._ | |
import reactivemongo.bson.handlers.BSONReader |
var request = require('request'); | |
var consumer_key = 'YOUR_CONSUMER_KEY'; | |
var consumer_secret = 'YOUR_CONSUMER_SECRET'; | |
var enc_secret = new Buffer(consumer_key + ':' + consumer_secret).toString('base64'); | |
var oauthOptions = { | |
url: 'https://api.twitter.com/oauth2/token', | |
headers: {'Authorization': 'Basic ' + enc_secret, 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, | |
body: 'grant_type=client_credentials' | |
}; |
##Theorem:
Given fmap id = id
:
fmap f . fmap g = fmap (f . g)
To prove this we're going to need a few lemmas:
// patch console.log to show filename and line number for every logged message | |
// | |
// ./src/index.js:68:9 √ Connected to Sentry | |
// ./src/index.js:72:9 √ Connected to Stripe | |
// ./src/index.js:82:9 √ Connected to Backblaze | |
// ./src/index.js:99:9 √ Connected to FireBase | |
// ./src/routes/paypal.js:68:17 Error: Request failed with status code 401 | |
// at createError (./node_modules/axios/lib/core/createError.js:16:15) | |
// at settle (./node_modules/axios/lib/core/settle.js:17:12) | |
// at IncomingMessage.handleStreamEnd (./node_modules/axios/lib/adapters/http.js:236:11) |
#Anonymous records. A solution to the problems of record-system.
Please, beware that the proposal that follows has been implemented as a library.
The current record system is notorious for three major flaws:
It does not solve the namespacing problem. I.e., you cannot have two records sharing field names in a single module. E.g., the following won't compile:
data A = A { field :: String }
/*jslint regexp: true, maxerr: 50, indent: 2 */ | |
(function (global) { | |
"use strict"; | |
function URLUtils(url, baseURL) { | |
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); | |
if (!m) { | |
throw new RangeError(); | |
} |
#!/bin/bash | |
START=$SECONDS | |
FILES=/var/www/vhosts/site.com/logs/access-2*.log | |
# Generate summary | |
goaccess /var/www/vhosts/site.com/logs/access.log --geoip-database /var/www/vhosts/site.com/logs/GeoIP.dat -o /var/www/vhosts/site.com/web/web/reports/summary.html | |
# Generate monthly reports | |
# -> Split logs |
This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.
A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:
import {extname} from 'path' | |
import {build, stop} from 'esbuild' | |
import {solidPlugin} from 'esbuild-plugin-solid' | |
import {denoPlugin} from 'esbuild_deno_loader' | |
const [input] = Deno.args | |
const ext = extname(input) | |
const compileOutput = input.replace(ext, '.compiled.js') | |
const bundleOutput = input.replace(ext, '.bundle.js') |