Skip to content

Instantly share code, notes, and snippets.

View nicoandmee's full-sized avatar
🏠
Working from home

Nico Kokonas nicoandmee

🏠
Working from home
View GitHub Profile
#!/usr/bin/env -S npx zx@dev --install --experimental --shell=/bin/zsh --quiet
import 'zx/globals';
import fs from 'fs-extra';
import { json2ts } from 'json-ts';
import plist from 'plist';
import _ from 'lodash';
import { runAppleScript } from 'run-applescript';
import {execa} from 'execa'
const macrosFile = `/Users/nico/dotfiles/.config/karabiner/ts/src/utils/.kmacros`;
#!/usr/bin/env zsh
# https://chat.openai.com/share/274e189a-9252-43e2-9ffa-a20f0fa096f0
tempfile=$(mktemp)
current_date=$(date +%Y-%m-%d)
# Run the AppleScript with the temporary file path, and in the background
osascript -e '
on fetchTabsFromChrome(tempFilePath)
tell application "Google Chrome"
@nicoandmee
nicoandmee / undefined
Last active May 28, 2025 03:50
Surfingkeys config 5/27/2025, 8:50:23 PM
var Li=Object.defineProperty;var ss=e=>{throw TypeError(e)};var ji=(e,t,o)=>t in e?Li(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var N=(e,t,o)=>ji(e,typeof t!="symbol"?t+"":t,o),ns=(e,t,o)=>t.has(e)||ss("Cannot "+o);var Oe=(e,t,o)=>(ns(e,t,"read from private field"),o?o.call(e):t.get(e)),jt=(e,t,o)=>t.has(e)?ss("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),xr=(e,t,o,s)=>(ns(e,t,"write to private field"),s?s.call(e,o):t.set(e,o),o);const E=(()=>{if(typeof window<"u"&&typeof api<"u")return console.debug("api",api),api;throw new Error("api not found")})(),Ae=document,Qt=window,xn=Ae.documentElement,We=Ae.createElement.bind(Ae),Pn=We("div"),Pr=We("table"),Di=We("tbody"),is=We("tr"),{isArray:cr,prototype:Rn}=Array,{concat:Ii,filter:_o,indexOf:An,map:Cn,push:qi,slice:Gn,some:Eo,splice:Ni}=Rn,Hi=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,zi=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,Mi=/<.+>/,Bi=/^\w+$/;function ao(e,t){const o=!!(s=t)&&s.nodeType===11;var s;return e
@nicoandmee
nicoandmee / obsidian-kk.py
Last active July 17, 2023 19:37
obsidian -> keycombiner
import csv
import json
import os
import time
from typing import Dict, List, Tuple
import click
import httpx
import pandas as pd
from icecream import ic
validation_images = [batch["image"] for batch in validation_dataset] # type: ignore
validation_labels = [batch["label"] for batch in validation_dataset] # type: ignore
def calculate_edit_distance(labels, predictions):
# Get a single batch and convert its labels to sparse tensors.
saprse_labels = tf.cast(tf.sparse.from_dense(labels), dtype=tf.int64)
# Make predictions and convert them to sparse tensors.
input_len = np.ones(predictions.shape[0]) * predictions.shape[1]
predictions_decoded = tf.keras.backend.ctc_decode(
@nicoandmee
nicoandmee / user.js
Created November 27, 2022 16:54 — forked from AetherEternity/user.js
Silent firefox
// Mozilla User Preferences
// To change a preference value, you can either:
// - modify it via the UI (e.g. via about:config in the browser); or
// - set it within a user.js file in your profile (create it if it doesn't exist).
//
// Profile folder location on different systems:
// Windows: C:\Users\<username>\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxxxx.default
// Mac OS X: Users/<username>/Library/Application Support/Firefox/Profiles/xxxxxxxx.default
// Linux: /home/<username>/.mozilla/firefox/xxxxxxxx.default
// playwright-extra is a drop-in replacement for playwright,
// it augments the installed playwright with plugin functionality
import { chromium } from 'playwright-extra'
// Load the stealth plugin and use defaults (all tricks to hide playwright usage)
// Note: playwright-extra is compatible with most puppeteer-extra plugins
import StealthPlugin from 'puppeteer-extra-plugin-stealth'
// Add the plugin to playwright (any number of plugins can be added)
chromium.use(StealthPlugin())

Keybase proof

I hereby claim:

  • I am nicoandmee on github.
  • I am nicomee (https://keybase.io/nicomee) on keybase.
  • I have a public key ASCV0KNXgPBt-qJo11QwSbpH7Y_rxuEbPbYktvDU2MbOHwo

To claim this, I am signing this object:

{
"arrowParens": "always",
"bracketSameLine": true,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 80,