Skip to content

Instantly share code, notes, and snippets.

@PrestonKnopp
PrestonKnopp / test_drag_and_drop.tscn
Created June 8, 2019 00:04
Examples of Godot's Control drag and drop functionality. Test it out by downloading this tscn and adding it to a Godot project. It is entirely self contained in one scene.
[gd_scene load_steps=6 format=2]
[sub_resource type="GDScript" id=1]
script/source = "extends Control
class DragDataColor:
var sender: Object
var color: Color"
[sub_resource type="GDScript" id=3]
@ninapavlich
ninapavlich / sort.js
Last active April 19, 2024 09:02
Deep Sort Javascript Object
function sortObject(object) {
//Thanks > http://whitfin.io/sorting-object-recursively-node-jsjavascript/
if (!object) {
return object;
}
const isArray = object instanceof Array;
var sortedObj = {};
if (isArray) {
sortedObj = object.map((item) => sortObject(item));
@justcallmelarry
justcallmelarry / README.md
Last active April 19, 2024 09:01
FastAPI signal handler

Useful if you need to have some sort of child process stop handling something on received termination signal, rather than when the service is shutting down

@aakropotkin
aakropotkin / nix-search.sh
Created March 13, 2019 01:27
FZF Fuzzy search for NixOS Options and Packages
#! /usr/bin/env bash
# Provided a list of package and option names (provided by my `writeOpts.sh` and
# `writePacks.sh` scripts), fuzzy search package and options information.
# The selection's definition will be opened in vim (as readonly) for viewing.
# NOTE: This script opens the result in a new URxvt window, you most likely will want
# to change that to open in the current window, or your own Terminal Emulator of
# choice. The current implementation is intended for use with a temporary XMonad
# scratchpad, which dies immediately after exiting (thus a new URxvt window is
# required).
@matthewzring
matthewzring / markdown-text-101.md
Last active April 19, 2024 09:01
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active April 19, 2024 09:01
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@dsernst
dsernst / typecheck.js
Last active April 19, 2024 08:58
Run typescript compiler in pre-commit hook
// Run this script to check our files for type errors
// using our existing tsconfig.json settings
//
// Usage: node typecheck.js
//
const fs = require('fs')
const stripJsonComments = require('strip-json-comments')
const tsConfig = JSON.parse(stripJsonComments(fs.readFileSync('./tsconfig.json', 'utf8')))
const { exec } = require('child_process')
@yorickdowne
yorickdowne / HallOfBlame.md
Last active April 19, 2024 08:58
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on IOPS, I/O Per Second. Budget SSDs will struggle to an extent, and some won't be able to sync at all.

This document aims to snapshot some known good and known bad models.

For size, 4TB or 2TB come recommended as of mid 2024. A 2TB drive should last an Ethereum full node until late 2025 or thereabouts, with crystal ball uncertainty.

High-level, QLC and DRAMless are far slower than "mainstream" SSDs. QLC has lower endurance as well. Any savings will be gone when the drive fails early and needs to be replaced.

@qoomon
qoomon / conventional_commit_messages.md
Last active April 19, 2024 08:55
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@p-alik
p-alik / etc-nixos
Last active April 19, 2024 08:55
NixOS config on Dell XPS 13 Plus 9320
# /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;