- How to add customized event and bind keymap
- The very beginner to zle of zsh keymapping with bindkey
⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates
What this will cover
- Host a static website at S3
- Redirect
www.website.com
towebsite.com
- Website can be an SPA (requiring all requests to return
index.html
) - Free AWS SSL certs
- Deployment with CDN invalidation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Making promises | |
*/ | |
let okPromise = Js.Promise.make((~resolve, ~reject as _) => [@bs] resolve("ok")); | |
/* Simpler promise creation for static values */ | |
Js.Promise.resolve("easy"); | |
Js.Promise.reject(Invalid_argument("too easy")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import { IO, Try, Success, Failure, Either, Left, Right, Cancelable, Duration } from "funfix" | |
import { RequestResponse } from "request" | |
import * as fs from "fs" | |
import * as request from "request" | |
import * as Url from "url" | |
import * as cheerio from "cheerio" | |
import * as minimist from "minimist" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
// Swagger-like API description | |
const api = { | |
'/users': { | |
'get': { | |
'parameters': { | |
'role': { | |
'in': 'query' | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsdom = require('jsdom').jsdom | |
const fs = require('fs') | |
const path = require('path') | |
const { | |
ContentState, | |
convertToRaw, | |
convertFromRaw, | |
} = require('draft-js') | |
const React = fs.readFileSync(path.join(__dirname, '../node_modules/react/dist/react.js')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AttributedString class from https://github.com/cohitre/attributedString.js | |
// Modifications made to support html tags & remove span wrapper from unstyled blocks | |
var AttributedString = (function () { | |
var aString | |
, StringRange | |
, RangesList | |
, HtmlSerializer | |
, plainStringSerializer | |
, _ = {} | |
, entityMap = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.haskellforall.com/2013/02/you-could-have-invented-comonads.html | |
const daggy = require('daggy'); | |
const {toUpper, prop, identity, range, curry, compose} = require('ramda'); | |
const Config = daggy.tagged("opts") | |
Config.prototype.inspect = function() { | |
return `Config(${this.opts})` | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://gist.github.com/quelgar/4661081 | |
const daggy = require('daggy'); | |
const {range} = require('ramda'); | |
// type to hold an index and the array | |
const Pointer = daggy.tagged('i', 'a') | |
// Comonad instance | |
Pointer.prototype.extract = function() { return this.a[this.i] } |
NewerOlder