Skip to content

Instantly share code, notes, and snippets.

View christiangenco's full-sized avatar

Christian Genco christiangenco

View GitHub Profile
@christiangenco
christiangenco / film_list.txt
Created January 4, 2026 15:21
Film collection - mark films you'd like to watch
============================================================
FILM COLLECTION
============================================================
CLASSIC/ADULT FILMS (120 titles)
----------------------------------------
[ ] 12 Angry Men (1957)
[ ] A Clockwork Orange (1971)
[ ] A Night at the Opera (1935)
[ ] A Place in the Sun (1951)
@christiangenco
christiangenco / alacritty-theme-switcher.sh
Last active October 9, 2025 13:13
Claude code automatic dark/light mode theme switching
#!/bin/bash
# Check if macOS is in dark mode
# Returns "Dark" if dark mode is on, nothing if light mode
DARK_MODE=$(defaults read -g AppleInterfaceStyle 2>/dev/null)
# Path to the active color config file
COLOR_FILE="$HOME/.config/alacritty/color.toml"
if [ "$DARK_MODE" = "Dark" ]; then
@christiangenco
christiangenco / example_embedding.js
Created April 17, 2024 19:06
Javascript + OpenAI Embedding Example
import "dotenv/config";
import { dot, norm, add, subtract } from "mathjs";
import OpenAI from "openai";
const openai = new OpenAI({ apiKey: process.env.OPENAI_KEY });
function cosineSimilarity(array1, array2) {
const dotProduct = dot(array1, array2);
const normA = norm(array1);
const normB = norm(array2);
const cosineSimilarity = dotProduct / (normA * normB);
@christiangenco
christiangenco / snapThings.rb
Last active July 13, 2023 14:47
Convert Things database into csv and json
#!/usr/bin/env ruby
# require 'sqlite3'
require 'shellwords'
require 'json'
require 'csv'
# require 'pry'
def tasks_to_csv(sqlite3_path, dest_path)
query = 'select TASK.*, AREA.title as areaTitle, PROJECT.title as projectTitle, HEADING.title as headingTitle'
@christiangenco
christiangenco / migrateHeroicons.js
Last active March 27, 2025 08:05 — forked from PicchiKevin/migrate.sh
Heroicons v1 to v2
const fs = require("fs");
if (!fs.existsSync("package.json")) {
console.error(
"Cannot find package.json. Please run this script in your project directory."
);
process.exit(1);
}
const package = fs.readFileSync("package.json", "utf8");
@christiangenco
christiangenco / nerdle_wordlist.txt
Last active April 30, 2024 11:33
Here's my best shot at a the 17,723-long wordlist for https://nerdlegame.com/
11-2-9=0
11-3-8=0
11-4-7=0
11-5-6=0
11-6-5=0
11-7-4=0
11-8-3=0
11-9-2=0
12-2*6=0
12-3-9=0
@christiangenco
christiangenco / Example.js
Created January 29, 2022 16:46
useStripe React Hooks for Stripe Firebase extension
import { Fragment, useEffect } from "react";
import {
useProducts,
useSubscriptions,
useStripeRole,
visitPortal,
useCreateCheckoutSession,
} from "hooks/useStripe";
@christiangenco
christiangenco / process.rb
Created April 15, 2021 15:18
Crop a bunch of burst photos and stitch them together into a video
paths = Dir.glob("*.jpg")
`mkdir -p cropped`
paths.sort.each_with_index{|path, i|
cropped_path = "cropped/#{i.to_s.rjust(2, "0")}.jpg"
starting_width = 3834
starting_height = 5751
width = starting_width
height = starting_width
@christiangenco
christiangenco / Example.js
Created February 27, 2021 17:31
React hook for mousetrap
import React from "react";
import useMousetrap from "./hooks/useMousetrap";
export default function Example(){
useMousetrap({
a: () => console.log("you pressed a"),
"ctrl+space": () => console.log("you pressed ctrl+space");
});
return "lol hi";
}
@christiangenco
christiangenco / ViewController.swift
Created December 30, 2020 02:13
Minimal macOS Swift app to show webcam video in a custom NSView
import Cocoa
import AVFoundation
// inspiration: https://www.youtube.com/watch?v=1_PUdhLQsZQ
class ViewController: NSViewController {
@IBOutlet weak var videoView: NSView!
private var cameraSession = AVCaptureSession()
private var camera: AVCaptureDevice!