Runs apache locally
./serve <domain name> <document directory>| <!DOCTYPE html> | |
| <html><head><meta charset="UTF-8"> | |
| <title>Redirection</title> | |
| </head><body> | |
| loading... | |
| </body><script> | |
| // change those: | |
| var google_analytics_ua = 'UA-XXXXX-Y' | |
| var next_url = "http://new-website.com" | |
| // don't touch below: |
| # Add a filename at the top of all jpegs in a given directory | |
| # to write directly over the image, remove -splice 0x75 | |
| # to include the extension, use "%[f]" instead of "%[t]" | |
| mogrify -pointsize 54 -background black -splice 0x75 -strokewidth 4 -fill black -stroke black -gravity north -annotate +0+20 "%[t]" -fill white -stroke none -annotate +0+20 "%[t]" *.jpg |
| const Identity = a => a | |
| const True = a => b => a | |
| const False = b => Identity | |
| const Condition = Predicate => Then => Else => Predicate(Then)(Else) | |
| const And = Exp1 => Exp2 => Exp1(Exp2)(Exp1) | |
| const Or = Exp1 => Exp2 => Exp1(Exp1)(Exp2) | |
| const Not = Predicate => value => !Predicate(value) | |
| const Defined = x => typeof x !== 'undefined' | |
| // aliases | |
| const T = True |
| const handlers = ( ( root = '', handlers = {} ) => { | |
| const path = require('path') | |
| const dir = path.join( __dirname, root ) // skip calling file (if it is in the same dir) | |
| const index_file = path.join( dir, 'index.js' ) // skip index.js | |
| require('fs').readdirSync(dir) | |
| .filter( file => { | |
| const curr = path.join(dir,file) | |
| return ( /\.js/.test(file) && curr !== __filename && curr !== index_file ) | |
| } ) | |
| .map( file => file.replace(/\.js/,'') ) |
| import * as React from 'react' | |
| import { Component } from 'react' | |
| import fitty, { Options, Fitted } from 'fitty' | |
| export type Props = Partial<Options> & {text?:string} & React.AllHTMLAttributes<HTMLSpanElement> | |
| export const style = | |
| { display: `inline-block` | |
| , whiteSpace: `nowrap` | |
| } |
| /** | |
| * Tired of re-typing the same component every time | |
| * This is a component that takes a value prop OR | |
| * handles value as a state, internally, OR | |
| * does both. | |
| * | |
| * It can also trigger the onChange event throttled, | |
| * instead of doing so on every key stroke | |
| */ |
| html, body{ | |
| padding:0; | |
| margin:0; | |
| } | |
| .main{ | |
| position: absolute; | |
| display: block; | |
| } |
| <!doctype html> | |
| <html lang=en> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>Event Dispatcher example</title> | |
| </head> | |
| <body> | |
| </body> | |
| <script> |
| export type Transformer<I,O> = (val:I)=>O | |
| export type Promisable<I,O> = (val:I) => Promise<O> | |
| export function composeSync<A,B>(a:Transformer<A,B>):(val:A)=>B | |
| export function composeSync<A,B,C>(a:Transformer<A,B>,b:Transformer<B,C>):(val:A)=>C | |
| export function composeSync<A,B,C,D>(a:Transformer<A,B>,b:Transformer<B,C>,c:Transformer<C,D>):(val:A)=>D | |
| export function composeSync<A,B,C,D,E>(a:Transformer<A,B>,b:Transformer<B,C>,c:Transformer<C,D>,d:Transformer<D,E>):(val:A)=>E | |
| export function composeSync<A,B,C,D,E,F>(a:Transformer<A,B>,b:Transformer<B,C>,c:Transformer<C,D>,d:Transformer<D,E>,e:Transformer<E,F>):(val:A)=>F | |
| export function composeSync<A,B,C,D,E,F,G>(a:Transformer<A,B>,b:Transformer<B,C>,c:Transformer<C,D>,d:Transformer<D,E>,e:Transformer<E,F>,f:Transformer<F,G>):(val:A)=>G | |
| export function composeSync<A,B,C,D,E,F,G,H>(a:Transformer<A,B>,b:Transformer<B,C>,c:Transformer<C,D>,d:Transformer<D,E>,e:Transformer<E,F>,f:Transformer<F,G>,g:Transformer<G,H>):(val:A)=>H |