#! /usr/bin/env bash | |
# Usage: git-io URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
URL="$1" | |
CODE="$2" |
[ Update 2020-05-31: I won't be maintaining this page or responding to comments anymore (except for perhaps a few exceptional occasions). ]
Most of the terminal emulators auto-detect when a URL appears onscreen and allow to conveniently open them (e.g. via Ctrl+click or Cmd+click, or the right click menu).
It was, however, not possible until now for arbitrary text to point to URLs, just as on webpages.
Rollup 0.48 introduces a few changes to the options
object, because the current options are confusingly different between the CLI and the options exported by your config file.
entry
is nowinput
sourceMap
andsourceMapFile
are nowsourcemap
andsourcemapFile
(note casing)moduleName
is nowname
useStrict
is nowstrict
The dest
and format
options are now grouped together as a single output: { file, format, ... }
object. output
can also be an array of { file, format, ... }
objects, in which case it behaves similarly to the current targets
. Other output options — exports
, paths
and so on — can be added to the output
object (though they will fall back to their top-level namesakes, if unspecified).
This is side-document providing details for some highlighted changes in 2.5.0. For a full list of changes, see the full release note.
/** | |
* Write JSX, but make sure you have `import html from 'htm/preact'` in your files. | |
* Run them through this horrid attrocity and get JSX support with basically no overhead. | |
*/ | |
export function transformJsxToHtm(code) { | |
const tokenizer = /(^|)(?:<\/([a-z$_][a-z0-9_.-:]*)>|<([a-z$_][a-z0-9_.-:]*)(\s+[a-z0-9._-]+(?:=(?:".*?"|'.*?'|\{.+?\}))?)*(\s*\/\s*)?>|<(\/?)>)/gi; | |
let out='', index=0, token; | |
let depth = 0; | |
let stacks = []; | |
let shouldPop = false; |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project: