Skip to content

Instantly share code, notes, and snippets.

@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;
@ClaytonHunt
ClaytonHunt / App.razor
Last active April 19, 2024 08:54
Dynamic Routing example in Blazor
<CascadingAuthenticationState>
<DynamicRouter AppAssembly="@typeof(Program).Assembly">
<Found>
<DynamicPage></DynamicPage>
</Found>
<NotFound>
Sorry no page
</NotFound>
</DynamicRouter>
</CascadingAuthenticationState>
@laytan
laytan / main.odin
Last active April 19, 2024 08:53
Raylib logging callback to Odin logger
logger: log.Logger
rl_log_buf: []byte
rl_log :: proc "c" (logLevel: rl.TraceLogLevel, text: cstring, args: libc.va_list) {
context = runtime.default_context()
context.logger = logger
level: log.Level
switch logLevel {
case .TRACE, .DEBUG: level = .Debug
case .ALL, .NONE, .INFO: level = .Info
@drubb
drubb / BackgroundBehavior.php
Last active April 19, 2024 08:52
Example for a paragraph behavior plugin
<?php
namespace Drupal\behaviors\Plugin\paragraphs\Behavior;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\paragraphs\Entity\Paragraph;
use Drupal\paragraphs\ParagraphInterface;
use Drupal\paragraphs\ParagraphsBehaviorBase;
@Williero
Williero / index.html
Created January 14, 2022 23:33 — forked from timothycarambat/index.html
Easy Web3 Meta Mask Login - static HTML and Vanilla JS
<html>
<head>
<title>Web3 Metamask Login</title>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="flex w-screen h-screen justify-center items-center">
<div class="flex-col space-y-2 justify-center items-center">
<button id='loginButton' onclick="" class="mx-auto rounded-md p-2 bg-purple-500 text-white">

CadQuery Shape primitives


3d shapes

Box

Workplane.box

result = cq.Workplane("XY" ).box(3, 3, 3)

07