Skip to content

Instantly share code, notes, and snippets.

View alex-kinokon's full-sized avatar
🇭🇰

Alex alex-kinokon

🇭🇰
  • Québec
View GitHub Profile
@alex-kinokon
alex-kinokon / README.md
Created November 22, 2023 04:55 — forked from dsample/README.md
ASCII art diagrams

ASCI art characters for creating diagrams

Characters:

Single line

  • ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
  • ASCII code 192 = └ ( Box drawing character single line lower left corner )
  • ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
  • ASCII code 194 = ┬ ( Box drawing character single line horizontal down )

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@alex-kinokon
alex-kinokon / eslint-import-require-node-prefix.js
Created May 22, 2023 06:05
eslint-import-require-node-prefix
// License: https://unlicense.org/
// @ts-check
const { builtinModules } = require("module");
/**
* @type {import("eslint").Rule.RuleModule}
*/
module.exports = {
meta: {
type: "problem",
import { borderRadius, clearfix } from '../mixin';
import { breadcrumb } from '../constants';
export default {
.breadcrumb {
padding: `${breadcrumb.padding.y} ${breadcrumb.padding.x}`;
margin-bottom: `${spacer.y}`;
list-style: none;
background-color: `${breadcrumb.bg}`;
... borderRadius(borderRadius);
import { reserved-words } from '../util/identifier'
import { get-options } from '../options'
import Tokenizer from '../tokenizer'
export const plugins = {}
export default class Parser extends Tokenizer
(options, @input) ->
options = get-options options
super options, @input
// Patched with createElementNS
// Does NOT patch SVGElement.cloneNode, sorry
/*!
Copyright (C) 2014-2015 by WebReflection
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
// ==UserScript==
// @name GitHub Instant
// @description Preloads GitHub content on link hover. CC0 Public Domain.
// @version 1.0
// @author Alex Mattrick
// @match https://github.com/*
// @match https://gist.github.com/*
// @icon https://assets-cdn.github.com/favicon.ico
// @require https://cdnjs.cloudflare.com/ajax/libs/instantclick/3.0.1/instantclick.min.js
// @grant none
// hasFont.js
// Detects whether a font exists on a client with pure JavaScript.
// Released under CC0 1.0 Public Domain Dedication
// https://creativecommons.org/publicdomain/zero/1.0/
// Boolean hasFont(String fontName)
// n.b. fontName should not have double quotation marks, i.e. `"`
// e.g. hasFont('monospace') // true
// hasFont('Helvetica Nonexistent') // false
var hasFont = (function(doc){
@alex-kinokon
alex-kinokon / curly.js
Last active August 29, 2015 14:22
curly.js
/* curly.js applies smart quotes (curly) to web pages that does not use it.
* (C) 2015 Alex Mattrick. CC0 Public Domain Dedication.
*/
var curlyquote = (function() {
// Elements with these tags will be ignored.
var ignoredTags = ['INPUT', 'PRE', 'CODE', 'SELECT', 'TEXTAREA', 'NOSCRIPT', 'SCRIPT'];
// Elements with these tags will NOT be considered a separate sentence.
var continuous = ['STRONG', 'EM', 'B', 'I', 'U', 'A', 'STRIKE', 'SPAN'];
@alex-kinokon
alex-kinokon / youtube-sanity.css
Last active August 29, 2015 14:15
Hide YouTube Comments
@-moz-document domain("youtube.com") {
#watch-discussion {
display: none !important;
}
}