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 July 18, 2025 00:03
Surfingkeys config 7/17/2025, 5:03:06 PM
(()=>{var e={135:e=>{!function(){"use strict";var t=document,n=window,o=t.documentElement,a=t.createElement.bind(t),i=a("div"),r=a("table"),s=a("tbody"),c=a("tr"),l=Array.isArray,p=Array.prototype,d=p.concat,u=p.filter,m=p.indexOf,h=p.map,g=p.push,f=p.slice,b=p.some,w=p.splice,y=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,v=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,k=/<.+>/,x=/^\w+$/;function S(e,t){var n,o=!!(n=t)&&11===n.nodeType;return e&&(o||L(t)||E(t))?!o&&v.test(e)?t.getElementsByClassName(e.slice(1).replace(/\\/g,"")):!o&&x.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e):[]}var _=function(){function e(e,o){if(e){if(C(e))return e;var a=e;if(N(e)){var i=o||t;if(!(a=y.test(e)&&L(i)?i.getElementById(e.slice(1).replace(/\\/g,"")):k.test(e)?Z(e):C(i)?i.find(e):N(i)?$(i).find(e):S(e,i)))return}else if(A(e))return this.ready(e);(a.nodeType||a===n)&&(a=[a]),this.length=a.length;for(var r=0,s=this.length;r<s;r++)this[r]=a[r]}}return e.prototype.init=function(t,n){return new e(t,n)},e}(),T=_.prototype,$=T.init;function C(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,