Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active May 7, 2024 07:50
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.
@m-jovanovic
m-jovanovic / .editorconfig
Created June 7, 2023 12:17
Sample editor config with a bunch of rules turned off 😅
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
@giuseppe998e
giuseppe998e / nixos-btrfs-tmpfs.md
Last active May 7, 2024 07:43
Install NixOS with BTRFS and IN-RAM root

Install NixOS with BTRFS and IN-RAM root

1. Format and partition the hard drive

  1. Create the GPT partition table
    • $ parted /dev/sdX mklabel gpt
  2. Create the UEFI FAT32 partition (which will be /dev/sdXY)
    • $ parted /dev/sdX mkpart esp fat32 1MiB 512MiB
    • $ parted /dev/sdX set 1 esp on
    • $ parted /dev/sdX set 1 boot on
  • $ mkfs.fat -F 32 -n UEFI /dev/sdXY
@fnky
fnky / ANSI.md
Last active May 7, 2024 07:40
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@chan-mai
chan-mai / gist:5bab0cc3655151b57bab3cb6363f9871
Last active May 7, 2024 07:40
問題のあるインスタンスをよしなにブロックしてくれるGASsc

スプレッドシートとにらめっこして手動で追加していくのに疲れたので作りました。 GASで動くのでタイムスケジュールを組んであげると幸せになれるかもしれません。

// CHANGE HERE
HOST = "" // サーバーのホスト部を指定  ex) shahu.ski
TOKEN = "" // 権限のあるトークンを指定

// スプシから問題のあるインスタンスのリストを取得
function getData(id, sheetName) {
@h3ssan
h3ssan / JetBrains trial reset.md
Last active May 7, 2024 07:39
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@smkplus
smkplus / UnityShaderCheatSheet.md
Last active May 7, 2024 07:34
Controlling fixed function states from materials/scripts in Unity

16999105_467532653370479_4085466863356780898_n

Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
 
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
@sesgoe
sesgoe / 01_scripts_and_styles.js
Last active May 7, 2024 07:32
Retool Realtime WebSocket
const webSocket = new WebSocket('wss://echo.websocket.org');
//Event listeners are the pillars upon which WebSockets are built. This event fires when the WebSocket is considered 'OPEN',
//which means that it has connected successfully.
webSocket.addEventListener('open', function(event) {
console.log('websocket connected successfully') //log this into the browser console so we can check if the websocket connected
});
//This is a global reference to the websocket that we created. We need this because otherwise multiple JS
@silas
silas / README.md
Created June 20, 2019 15:15
Anki JavaScript Cards

Anki JavaScript Cards

This demonstrates one method for creating JavaScript based Anki cards.

Tested on

  • [Anki for desktop computers][anki-desktop] version 2.1.13
  • [AnkiMobile][anki-mobile] (iOS) version 2.0.48

Instructions