Skip to content

Instantly share code, notes, and snippets.

@silassare
silassare / fix-esm-import-paths.js
Created July 21, 2022 09:58
Browse a folder and try to change all esm import `from`, by auto prefixing `.js` or `/index.js` only if this file exists.
import * as fs from 'fs';
import * as path from 'path';
// https://gist.github.com/lovasoa/8691344
async function* walk(dir) {
for await (const d of await fs.promises.opendir(dir)) {
const entry = path.join(dir, d.name);
if (d.isDirectory()) {
yield* walk(entry);
} else if (d.isFile()) {
@ceejbot
ceejbot / skyrimse_visual_mods.md
Last active April 22, 2022 21:52
skyrim special edition visual mods, a brief discussion

Skyrim mods redux

Skyrim mods are why the game is alive eight years after it was launched. They’re amazing and fantastic and disturbing and inspiring. They fix game bugs, add new features, and make the game look fresh.

I am happily role-playing my way through my social distancing 2020 playthrough, posting ridiculous screenshots. Sometimes people on Twitter ask me for a modlist. My modlist is on Modwatch. But... I'm not sure this helps anyway. This list is names of plugin files, not mod names, so it can be super-confusing to read. Also, let’s be honest: this list of mods is bewildering to the newcomer. If you wanted to mod Skyrim so it looks and plays wonderfully, my modlist would not help you get started.

So what would help you get started? Well, how about Ceejbot’s introduction to Skyrim modding?

This is not a modding guide. A modding guide sets out to help you build a specific modlist that works well together, without bugs. I'

@s41m0n
s41m0n / linuxNvidia_guide.md
Last active January 31, 2024 22:23
This guide is supposed to help people experiencing problems with the Nvidia dedicated graphic card management.

Linux - Nvidia switchable setup guide

The aim of this guide is to provide a working strategy to make your dedicated graphic card turn on/off correctly in a Linux environment (with xorg).

The following scripts have been created by tyrells and this guide is a remake of Graff's one.

Required Packages

The following two packages are stricly required:

@fokusferit
fokusferit / enzyme_render_diffs.md
Last active April 15, 2024 09:41
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@rchanou
rchanou / SemiControlledInput.js
Last active January 4, 2021 02:35
Semi-Controlled Input
export default class Input extends React.Component {
static defaultProps = {
onChange() {},
onFocus() {},
onBlur() {}
};
constructor(props) {
super();
this.state = {
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
@bcoe
bcoe / npm-top.md
Last active March 23, 2024 20:02
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@jlongster
jlongster / immutable-libraries.md
Last active September 11, 2021 08:32
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@pkgw
pkgw / partial .XCompose
Last active January 13, 2024 13:06
A fragment of a ~/.XCompose file that adds compose-key combinations for typing Greek letters, blackboard bold capitals, and a nonbreaking space.
# PKGW customizations
# Greek ambiguities: epsilon/eta, theta/tau, pi/phi/psi, omega/omicron
<Multi_key> <backslash> <comma> : " " U202F # thin nonbreaking space
<Multi_key> <g> <a> : "α"
<Multi_key> <g> <b> : "β"
<Multi_key> <g> <g> : "γ"
<Multi_key> <g> <d> : "δ"
<Multi_key> <g> <3> : "ε" # note!