Skip to content

Instantly share code, notes, and snippets.

@Risto-Stevcev
Risto-Stevcev / suckless-st-sixel.diff
Created June 19, 2023 13:48 — forked from saitoha/suckless-st-sixel.diff
Add SIXEL graphics support for suckless st. (sixel.c/sixel_hls.c come from mintty, licensed under GPL)
commit ea830e03d4d4562b1ff225940f65bceddd9cad6c
Author: Hayaki Saito <[email protected]>
Date: Sun Jun 11 23:46:45 2017 +0900
Add sixel graphics support
Signed-off-by: Hayaki Saito <[email protected]>
diff --git a/Makefile b/Makefile
index d8595fe..a25d040 100644
@Risto-Stevcev
Risto-Stevcev / ANSI.md
Last active June 2, 2023 03:43 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@Risto-Stevcev
Risto-Stevcev / esm-package.md
Created June 2, 2023 03:36 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Risto-Stevcev
Risto-Stevcev / categories.hs
Created March 13, 2019 21:02
Is everything just a monoid in the category of something?
(.) :: (b -> c) -> (a -> b) -> (a -> c) -- functions
(.) :: cat b c -> cat a b -> cat a c -- categories
(++) :: String -> String -> String -- strings
(<>) :: a -> a -> a -- monoids
(<>) :: cat a a -> cat a a -> a a -- categories
(++) :: [a] -> [a] -> [a] -- lists
(<|>) :: f a -> f a -> f a -- alternatives
(<|>) :: cat a a -> cat a a -> a a -- categories
@Risto-Stevcev
Risto-Stevcev / test.ml
Created July 31, 2018 15:51 — forked from infinity0/test.ml
OCaml GADTs and avoiding "type constructor would escape its scope" errors
(* GADT list that exposes the type of the head element *)
type _ hlist =
| Nil: 'a hlist
| Cons: ('a * 'b hlist) -> 'a hlist
(* let rec len = function *)
(* let rec len (type a) (l: a hlist): int = match l with *)
(* both of the above result in a "type constructor would escape its scope" error *)
(* correct version: *)
let rec len : type a. a hlist -> int = function
@Risto-Stevcev
Risto-Stevcev / what-forces-layout.md
Created June 22, 2018 07:16 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
type scalar = float
type 'a one = [`one of 'a]
type 'a z = [`zero of 'a]
type 'a two = [`two of 'a]
type 'a three = [`three of 'a]
type 'a four = [`three of 'a]
let map2 f x y = Array.init (min (Array.length x) (Array.length y))
(fun n -> f x.(n) y.(n))
@Risto-Stevcev
Risto-Stevcev / sig
Created December 7, 2017 11:16 — forked from yawaramin/sig
Bourne Shell script to print out Merlin's inferred signature of an OCaml file (module)
#!/usr/bin/env sh
# Works with merlin version 2.5.4. Using protocol described at
# https://github.com/ocaml/merlin/blob/master/doc/dev/OLD-PROTOCOL.md#type-checking
usage ()
{
echo Usage: either of the following will work:
echo
echo ' sig module.ml'
@Risto-Stevcev
Risto-Stevcev / object-watch.js
Created November 16, 2017 22:47 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@Risto-Stevcev
Risto-Stevcev / AssocList.purs
Created November 14, 2017 13:08 — forked from Thimoteus/AssocList.purs
records as association lists
module AssocList where
import Data.List (List(..))
import Data.Record (delete, get)
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
import Data.Tuple (Tuple(..))
import Type.Row (class RowLacks, class RowToList, Cons, Nil, RLProxy(RLProxy), kind RowList)
class RLToList
(rl :: RowList)