This file contains 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/qjs | |
// Initial hyperscript test cases, framework-independent. | |
// ./h.test.js|tee h.test~|diff -u h.test -&&echo ok h.test||echo fail h.test | |
// 0BSD / public domain. 2020 Denys Nykula <nykula@ukr.net> | |
// TODO h("p", h("hr")), h("p", h("hr"), "2020"), h("p", "2020", h("hr")) | |
// TODO h('a[href=#][title="hyper script"]') | |
function h(s, a, c) { | |
if (!c && a && ("" + a === a || 0 in a)) (c = a), (a = {}); | |
(a = a || {}), (c = c || []); | |
if ("" + s !== s) return s(a, c); |
This file contains 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
#!/bin/sh | |
perl -i -pe 's|^\s*([^<].*)$|<p>$1</p>|g' "$1" | |
perl -i -pe 's/(\s| )+(–|—|-)\s+/ — /g' "$1" | |
perl -i -pe 's|href=|href@=|g' "$1" | |
perl -i -pe 's|id=|id@=|g' "$1" | |
perl -i -pe 's|src=|src@=|g' "$1" | |
perl -i -pe 's|\s*\w+="[^"]*"||g' "$1" | |
perl -i -pe 's|@=|=|g' "$1" | |
perl -i -pe 's|<p><br\s*/?>|<p>|g' "$1" | |
perl -i -pe 's|</?span>||g' "$1" |
This file contains 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
#!/bin/bash | |
perl -i -pe 's/{{ ?/{/g' "$@" | |
perl -i -pe 's/ ?}}/}/g' "$@" | |
perl -i -pe 's/\$?(ctrl|self)/this/g' "$@" | |
perl -i -pe 's/= function//g' "$@" | |
perl -i -pe 's/\$onInit\s+\(\) {/constructor(props) {\nsuper(props)\n/g' "$@" | |
perl -i -pe 's/\$postLink\s+\(\) {/componentDidMount() {/g' "$@" | |
perl -i -pe 's/\.(\$|api|dialog|env|glue|store)/.props.\1/g' "$@" | |
perl -i -pe 's/<br>/<br \/>/g' "$@" |
This file contains 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
import Nullthrows from "@makepost/nullthrows"; | |
class Post { | |
id = ""; | |
} | |
interface ICallback<T> { | |
(error: Error, _?: undefined): void; | |
(_: undefined, post: T): void; | |
} |
This file contains 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
class Post { | |
id = ""; | |
} | |
interface ICallback<T> { | |
(error: Error, _?: any): void; | |
(_: any, post: T): void; | |
} | |
const callback: ICallback<Post> = (error: Error, post: Post) => { |
This file contains 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
# Packages # | |
############ | |
# it's better to unpack these files and commit the raw source | |
# git has its own built in compression methods | |
*.7z | |
*.dmg | |
*.gz | |
*.iso | |
*.jar | |
*.rar |