Skip to content

Instantly share code, notes, and snippets.

View shuritch's full-sized avatar
:shipit:

Alexander Ivanov shuritch

:shipit:
View GitHub Profile
@shuritch
shuritch / nixos.nix
Created December 11, 2023 16:36
My nixos configuration
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot = {
@shuritch
shuritch / ranger-cheatsheet.md
Last active January 14, 2024 16:08 — forked from heroheman/ranger-cheatsheet.md
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@shuritch
shuritch / Stringify.js
Last active March 23, 2024 13:15
Safe json stringifier
'use strict';
const MAX_DEPTH = 10;
const MAX_ITEMS = 100;
const ROOT_NAME = 'root';
const stringify = Stringify.bind({ maxItems: MAX_ITEMS, maxDepth: MAX_DEPTH, name: ROOT_NAME });
// prettier-ignore
/* eslint-disable consistent-return */
function Stringify(sample, key = this.name ?? 'root', stack = new WeakMap()) {