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
catwell / try-userland.sh
Created Oct 22, 2019
Use Hisham's userland on Arch Linux
View try-userland.sh
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
View 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 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
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
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
catwell / index.html
Created Aug 8, 2019
Elix component example
View index.html
<!DOCTYPE html>
<head>
<script type="module" src="https://component.kitchen/modules/FilterComboBox.js"></script>
</head>
<body>
<elix-filter-combo-box>
View slite-custom-css-fix-tables.css
/* Fix tables display in note view */
.note-view-centered-content {
max-width: none;
}
@catwell
catwell / light-dom.css
Created Jul 14, 2019
avoid-flash-of-unstyled-slot-stencil
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)
end
-local encode = function(r, k, v, boundary)
+local encode_header = function(r, k, v, boundary)
@catwell
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: https://babeljs.io/repl/ .
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.