Skip to content

Instantly share code, notes, and snippets.

@hohonuuli
hohonuuli / WarpHere.scpt
Created February 19, 2024 01:06
AppleScript to open a Warp tab at the current location in the finder
(*
WarpHere by Brian Schlining
2024-02-18
*)
-- when the toolbar script icon is clicked
--
on run
tell application "Finder"
try
@hohonuuli
hohonuuli / auto-analyze.sc
Created June 28, 2023 18:31
Proof of concept script to analyze video using ML via beholder and pythia services
#!/usr/bin/env -S scala-cli shebang
//> using scala "3.3.0"
//> using dep "com.lihaoyi::requests:0.8.0"
//> using dep "com.lihaoyi::mainargs:0.5.0"
//> using dep "com.lihaoyi::upickle:3.1.0"
import requests.*
import mainargs.{main, arg, ParserForMethods, Flag}
import upickle.default.*
import java.nio.file.{Files, Paths}
@hohonuuli
hohonuuli / Material.cottheme
Created June 25, 2023 19:16
Material Theme for Cot Editor
{
"attributes" : {
"color" : "#b97ae5"
},
"background" : {
"color" : "#1c252b"
},
"characters" : {
"color" : "#7b9c55"
},
@hohonuuli
hohonuuli / PlayContextSampleQuery.sql
Last active April 11, 2023 18:35
Initial Test Output
SELECT play_context_responses.created_at,
play_context_responses.updated_at,
play_context_responses.id,
play_context_responses.details,
play_context_responses.user_id,
play_context_responses.play_context_id,
bounding_box_specs_1.created_at AS created_at_1,
bounding_box_specs_1.updated_at AS updated_at_1,
bounding_box_specs_1.id AS id_1,
bounding_box_specs_1.description,
@hohonuuli
hohonuuli / Makefile
Created December 12, 2022 16:33 — forked from GavinRay97/Makefile
A Makefile to compile a Maven/Gradle-style project layout using a custom JDK (for use w/ IE, Valhalla)
# Makefile to compile and run Java sources manually
# because JDK 20 Valhalla support is not yet available in IntelliJ IDEA
JAVA_VERSION = 20
JAVAC = /home/user/downloads/jdk-20-vahalla-20-75/bin/javac
JAVA = /home/user/downloads/jdk-20-vahalla-20-75/bin/java
JAVA_COMPILE_OPTIONS = --enable-preview --release $(JAVA_VERSION)
JAVA_OPTIONS = --enable-preview
JAVA_MAIN_CLASS = org.example.Database
@hohonuuli
hohonuuli / Go to folder in Warp.applescript
Last active December 5, 2022 17:19
Script for CotEditor. Opens the parent directory of the currently edited file in Warp
property showAlertDialog : true
-- get file path from CotEditor
tell application "CotEditor"
if not (exists front document) then return
set theFile to file of front document
end tell
-- end script if no file path is specified
@hohonuuli
hohonuuli / loom.sc
Created October 19, 2022 04:12
Scala/Loom example for a medium article
#!/usr/bin/env -S scala-cli shebang --scala-version 3.2.0 -J --enable-preview -J --add-modules=jdk.incubator.concurrent
import scala.util.Using
import java.util.concurrent.ScheduledThreadPoolExecutor
import jdk.incubator.concurrent.StructuredTaskScope
Thread.startVirtualThread(() => println("Hello from virtual thread"))
println("Hello from main thread")
@hohonuuli
hohonuuli / Loom.java
Created October 19, 2022 04:06
Loom example for medium article
import jdk.incubator.concurrent.StructuredTaskScope;
// java --enable-preview --source 19 --add-modules jdk.incubator.concurrent Loom.java
public class Loom {
public static void main(String[] args) {
run();
}
public static void run() {
@hohonuuli
hohonuuli / voc_to_csv.sc
Created October 19, 2022 03:58
Scala script to convert Pascal VOC to CSV. For a medium article
#!/usr/bin/env -S scala-cli shebang --scala-version 3.2.0
//> using lib "org.scala-lang.modules::scala-xml:2.1.0"
import scala.xml.Elem
import java.io.File
import scala.xml.XML
import java.nio.file.Paths
import scala.util.Using
import java.nio.file.Files
<template>
<div class="map-box" id="maptest"></div>
</template>
<script>
import Vue from 'vue'
// If you need to reference 'L', such as in 'L.icon', then be sure to
// explicitly import 'leaflet' into your component
import L from 'leaflet'