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 November 11, 2024 21:58
Surfingkeys config 11/11/2024, 2:58:48 PM
(()=>{var e={385:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function a(e,o,r){return a=n()?Reflect.construct:function(e,n,a){var o=[null];o.push.apply(o,n);var r=new(Function.bind.apply(e,o));return a&&t(r,a.prototype),r},a.apply(null,arguments)}function o(e){return r(e)||i(e)||s(e)||c()}function r(e){if(Array.isArray(e))return l(e)}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.fr
@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,
@nicoandmee
nicoandmee / getcrx.sh
Last active July 23, 2022 22:10 — forked from bitst0rm/getcrx.sh
A bash script to download chrome extension files from Chrome Web Store
#!/usr/bin/env bash
# A bash script to download chrome extension files from Chrome Web Store
# 30.12.2018, https://github.com/bitst0rm
# 23.07.2022 https://github.com/nicoandmee
# extensions.zip contains URLs to download
if [ ! -f ./extensions.txt ]; then
echo "Missing extensions.txt file."
echo "extensions.txt should contain newline delimited list of webstore links."