Skip to content

Instantly share code, notes, and snippets.

View catwell's full-sized avatar

Pierre Chapuis catwell

View GitHub Profile
@catwell
catwell / mercury-new.sh
Last active February 1, 2020 18:53
Use Mercury
wget https://raw.githubusercontent.com/oploadk/localua/master/localua.sh
sh localua.sh lua 5.1.5
./lua/bin/luarocks install https://raw.githubusercontent.com/catwell/mercury/master/rockspecs/mercury-scm-0.rockspec
wget https://raw.githubusercontent.com/catwell/mercury/master/samples/greetings.lua
./lua/bin/mercury greetings
@catwell
catwell / try-userland.sh
Created October 22, 2019 17:50
Use Hisham's userland on Arch Linux
pacman -S love
git clone git@github.com:hishamhm/userland.git
cd userland
wget https://raw.githubusercontent.com/oploadk/localua/master/localua.sh
sh localua.sh localua 5.1.5
ln -s ./localua/bin/luarocks .
./luarocks install inspect
./luarocks install userland-dev-1.rockspec
./userland
@catwell
catwell / keybase.md
Created September 11, 2019 08:36
keybase.md

Keybase proof

I hereby claim:

  • I am catwell on github.
  • I am catwell (https://keybase.io/catwell) on keybase.
  • I have a public key ASAAdSIRAsiSsw-jaAXD49EPC6xYhc8Kncp1eFI7uUqB2Qo

To claim this, I am signing this object:

@catwell
catwell / typeguard-discriminated-union.ts
Created August 28, 2019 12:14
TypeScript - Type Guard for Discriminated Unions with Extract
export interface Chunky {
kind: 'chunky';
/* ... */
}
export interface Bacon {
kind: 'bacon';
/* ... */
}
@catwell
catwell / generic-typeguard-option-1.ts
Last active August 28, 2019 12:02
TypeScript Generic Type Guards
interface _typeMap {
chunky: Chunky;
bacon: Bacon;
}
type _stuffKind = keyof _typeMap;
export interface Stuff {
kind: _stuffKind;
/* ... */
@catwell
catwell / tsx.sublime-keymap
Created August 12, 2019 14:18
Enable Emmet and tag auto-close in Sublime Text
[
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
@catwell
catwell / index.html
Created August 8, 2019 08:56
Elix component example
<!DOCTYPE html>
<head>
<script type="module" src="https://component.kitchen/modules/FilterComboBox.js"></script>
</head>
<body>
<elix-filter-combo-box>
/* Fix tables display in note view */
.note-view-centered-content {
max-width: none;
}
@catwell
catwell / light-dom.css
Created July 14, 2019 14:55
avoid-flash-of-unstyled-slot-stencil
my-component {
display: none;
}
my-component[is-loaded] {
display: block;
}
diff --git a/multipart-post.lua b/multipart-post.lua
index 85b8096..86d44db 100644
--- a/multipart-post.lua
+++ b/multipart-post.lua
@@ -40,7 +40,7 @@ local gen_boundary = function()
return table.concat(t)
end
-local encode = function(r, k, v, boundary)
+local encode_header = function(r, k, v, boundary)