Skip to content

Instantly share code, notes, and snippets.

Pierre Chapuis catwell

Block or report user

Report or block catwell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
catwell /
Created Oct 22, 2019
Use Hisham's userland on Arch Linux
pacman -S love
git clone
cd userland
sh localua 5.1.5
ln -s ./localua/bin/luarocks .
./luarocks install inspect
./luarocks install userland-dev-1.rockspec

Keybase proof

I hereby claim:

  • I am catwell on github.
  • I am catwell ( on keybase.
  • I have a public key ASAAdSIRAsiSsw-jaAXD49EPC6xYhc8Kncp1eFI7uUqB2Qo

To claim this, I am signing this object:

catwell / typeguard-discriminated-union.ts
Created Aug 28, 2019
TypeScript - Type Guard for Discriminated Unions with Extract
View typeguard-discriminated-union.ts
export interface Chunky {
kind: 'chunky';
/* ... */
export interface Bacon {
kind: 'bacon';
/* ... */
catwell / generic-typeguard-option-1.ts
Last active Aug 28, 2019
TypeScript Generic Type Guards
View generic-typeguard-option-1.ts
interface _typeMap {
chunky: Chunky;
bacon: Bacon;
type _stuffKind = keyof _typeMap;
export interface Stuff {
kind: _stuffKind;
/* ... */
catwell / tsx.sublime-keymap
Created Aug 12, 2019
Enable Emmet and tag auto-close in Sublime Text
View tsx.sublime-keymap
"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 / index.html
Created Aug 8, 2019
Elix component example
View index.html
<!DOCTYPE html>
<script type="module" src=""></script>
View slite-custom-css-fix-tables.css
/* Fix tables display in note view */
.note-view-centered-content {
max-width: none;
catwell / light-dom.css
Created Jul 14, 2019
View light-dom.css
my-component {
display: none;
my-component[is-loaded] {
display: block;
View lmp-encode.diff
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)
-local encode = function(r, k, v, boundary)
+local encode_header = function(r, k, v, boundary)
catwell / main.js
Created Jul 3, 2019 — forked from kdzwinel/main.js
List all undefined CSS classes
View main.js
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
You can’t perform that action at this time.