Skip to content

Instantly share code, notes, and snippets.

@default-anton
default-anton / Technologies.md
Last active July 21, 2024 20:46
Code Assistant Prompt

Since I'm using this prompt in Neovim, the list of technologies changes based on the type of file I currently have open. Here's the list of technologies:

Filetype Technologies
ruby Ruby, Ruby on Rails, RSpec, Capybara
eruby Ruby, Ruby on Rails, RSpec, Capybara, HTML5, CSS3, JavaScript, Tailwind CSS
lua Neovim, LuaJIT
html HTML5, CSS3, JavaScript, Tailwind CSS
javascript HTML5, CSS3, JavaScript, Tailwind CSS
@acutmore
acutmore / ts-blank-space-doc.md
Last active September 20, 2024 03:45
Learnings from 'ts-blank-space`

Learnings from ts-blank-space

tags: TypeScript, type erasure, type stripping

ts-blank-space

As part of my work on the JavaScript Tooling team at Bloomberg I have implemented an experimental (not yet used in production) package to transform TypeScript into JavaScript using a somewhat novel approach.

This is a description of what I learned from implementing the idea. The source code will be open sourced soon - it just needs some regular IP approval.

@gabe565
gabe565 / change-arc-icon.md
Last active April 28, 2025 04:28
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon on macOS.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy
{
"extends": "../../.eslintrc.json",
"overrides": [
{
"files": [
"*.ts"
],
"rules": {
"no-restricted-imports": [
"error",
@lacolaco
lacolaco / 1.ngx-reactify.tsx
Last active September 11, 2024 09:51
A React component to render a standalone Angular component (Angular v14.2 is required)
import { ApplicationRef, ComponentRef, createComponent, Type } from "@angular/core";
import { createApplication } from "@angular/platform-browser";
import React, { useEffect, useRef, useState } from "react";
type AnyComponentRef = ComponentRef<unknown>;
export type ReactifyProps = {
component: Type<unknown>;
inputs?: Record<string, unknown>;
};

Cheat sheet: public prototype methods and accessors

const getterKey = Symbol('getterKey');
const setterKey = Symbol('setterKey');
const syncMethodKey = Symbol('syncMethodKey');
const syncGenMethodKey = Symbol('syncGenMethodKey');
const asyncMethodKey = Symbol('asyncMethodKey');
const asyncGenMethodKey = Symbol('asyncGenMethodKey');
module type Kind_1 = sig
type _ t
type content
type content_t
val to_a_t : content t -> content_t
val of_a_t : content_t -> content t
end
type 'a kind_1 = (module Kind_1 with type content = 'a)
type exists<V> = <Y>(p: (v: V) => Y) => Y;
// module interface
type Unique_S<T> = {
next: () => T,
equal: (a: T, b: T) => boolean,
compare: (a: T, b: T) => number,
show: (t: T) => string,
};

A Runtime ImportMap Example - now as a module

While it's not possible to define a <script type="importmap"> within a module, it is possible to define it in a synchronous <script> tag, as long as it's before any module starts executing.

Example (works in Chrome / Edge / WebKit / Safari / Firefox)

<!DOCTYPE html>
<html lang="en">
<head>
@idkjs
idkjs / tailcall.re
Last active July 21, 2021 22:34
Using the `@tailcall` annotation in ReasonML
let sum = n => {
let rec loop = (n, k) =>
if (n == 0) {
k(0);
} else {
([@tailcall] loop)(n - 1, x => k(x + n));
};
([@tailcall] loop)(n, x => x);
};