Skip to content

Instantly share code, notes, and snippets.

View jasalt's full-sized avatar

Jarkko Saltiola jasalt

View GitHub Profile
@m3tti
m3tti / pdf-to-text.cljs
Last active May 1, 2025 14:23
Convert PDF to text with pdf.js
(ns pdf-to-txt
(:require
["pdfjs-dist" :as pdfjs]))
(assoc!
pdfjs.GlobalWorkerOptions
:workerSrc "https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.mjs")
(defn cleanup-text [txt]
(.replaceAll txt "\"" "'"))
@pmarreck
pmarreck / comparison-of-shells.md
Last active May 22, 2025 01:55
Comparison of Bash, Elvish, NuShell, Murex, es-shell, fish, xonsh, PowerShell, Oil and Ion shells

(generated by chatgpt 4o and reviewed/edited by claude 3.5 sonnet, YMMV)

| Feature | Bash | Elvish | NuShell | Murex | Es Shell | Fish | Xonsh | PowerShell | Oil | Ion | |----------------------------------|-----------------------------------------------|-----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|-------------------------

@ikitommi
ikitommi / demo.clj
Last active April 25, 2025 22:51
OpenAI API Structured Outputs in Clojure with Malli
(ns summer.demo
(:require [summer.openai :as openai]))
(def Step
[:map
[:explanation :string]
[:output :string]])
(def MathResponse
[:map {:name "mathresponse"}
@jarppe
jarppe / proxy_byte_channels_example.clj
Created June 16, 2024 12:17
Converting Channel to Java InputStream and OutputStream using proxies
(ns proxy-byte-channels-example
(:import (java.io InputStream
OutputStream)
(java.nio ByteBuffer)
(java.net UnixDomainSocketAddress
StandardProtocolFamily)
(java.nio.channels ByteChannel
SocketChannel)
(java.nio.charset StandardCharsets)))
@Geczy
Geczy / readme.md
Last active June 6, 2025 15:36
Migrate Coolify to a new server
@jasalt
jasalt / thinkfan.conf
Last active November 26, 2023 15:30
Fan profile (/etc/thinkfan.conf) for keeping Skylake Thinkpads silent at work
# This fan config helps to keep Thinkpad silent at work
# With it eg. 200$ second-hand 2-core Skylake laptop T460 and onwards can encode 1440p 30fps h264/h265 with
# Intel QuickSync HW encoder via proprietary VA-API driver https://wiki.debian.org/HardwareVideoAcceleration,
# silently, and stream it via OBS (RTMP/SRT/NDI..) etc..
# To use this fan config on a single-fanned Thinkpad with Debian and systemd, run:
# sudo apt install thinkfan
# sudo echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkpad_acpi.conf
@ssrihari
ssrihari / clojure-learning-list.md
Last active June 12, 2025 08:03
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@prestancedesign
prestancedesign / web.clj
Last active May 25, 2025 21:25
Ring session authentication with Reitit
(ns authexample.web
(:gen-class)
(:require [buddy.auth :refer [authenticated? throw-unauthorized]]
[buddy.auth.backends.session :refer [session-backend]]
[buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
[clojure.java.io :as io]
[compojure.response :refer [render]]
[reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[ring.middleware.params :refer [wrap-params]]
@jenswittmann
jenswittmann / functions.php
Last active July 3, 2024 18:10
Timber embed SVG Plugin for WordPress
/**
* embed SVG
* Example: <span>{{ "logo"|svg }}</span>
*
* @param \Twig\Environment $twig The Twig environment.
* @return \Twig\Environment
*/
function twig_svg_embed($twig)
{
$twig->addFilter(
@FreddieOliveira
FreddieOliveira / docker.md
Last active June 8, 2025 10:57
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary