Skip to content

Instantly share code, notes, and snippets.

View nxtk's full-sized avatar
NO COFFEE, NO WORKEE

Ivan Koz nxtk

NO COFFEE, NO WORKEE
View GitHub Profile
@nxtk
nxtk / parse.clj
Created April 22, 2024 18:48
Barebones kicad footprint parser script to extract groups of entities.
#!/usr/bin/env bb
#_{:clj-kondo/ignore [:use]}
(ns parse
(:use [clojure.core] :reload)
(:require [clojure.string :as str]
[clojure.java.io :as io]
[clojure.pprint :as pp]))
(def footprints {:switch "!nxtk_V1_V2_HS_reversible_plated.kicad_mod"
@nxtk
nxtk / gpg-ssh-setup.md
Created April 9, 2024 02:09 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@nxtk
nxtk / isrt-linux
Created April 6, 2024 19:06 — forked from semilin/isrt-linux
NotGate's ISRT Layout for Linux XKB
// Standard ISRT for ANSI and ISO keyboards
default partial
xkb_symbols "basic" {
// the default variant has no AltGr layer and does
// not use CAPS as BackSpace
include "us(basic)"
@nxtk
nxtk / youtube_unsubscribe.js
Last active March 6, 2024 08:33
youtube unsubscribe by hotkey
// https://www.youtube.com/feed/channels
// paste to the console, press `d` while hovering over a channel block
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function channelName() {
var hoverNode = Array.from(document.querySelectorAll(":hover")).filter(e => e.id == 'content-section').pop();
var nameNode = hoverNode.querySelector("#text-container.ytd-channel-name");
@nxtk
nxtk / flyway.clj
Created February 15, 2020 16:14
flyway migration
(ns startrek.migration
(:import
[org.flywaydb.core Flyway]
[org.flywaydb.core.api.configuration FluentConfiguration]))
(set! *warn-on-reflection* true)
(defn flyway
[datasource migration-locations]
(Flyway. (doto
; This is the next iteration of the CRUD metamodel that powers Hyperfiddle
; Just a design sketch, the current metamodel in prod is different
; CRUD definition
{identity ; Pass through URL params to query
[{:dustingetz/event-registration ; virtual attribute identifying a query
[:db/id
(:dustingetz/email {:hf/a :dustingetz/registrant-edit}) ; hyperlink to detail form
:dustingetz/name
{:dustingetz/gender