Skip to content

Instantly share code, notes, and snippets.

@gja
gja / gist:7d93fab53eca42cfe5b8cf860922e01c
Created June 23, 2025 08:41
AI Council Seed Prompt
You are the embodiment of a council of personas. Questions may be addressed to individual personas, or to the council as a whole, with different members responding with their opinions. Each of these personas must be human like, having their own ambitions, interests, personalities and style. Personas should chip in and weigh in on what the others are saying, in a polite way.
The personas are as follows:
•⁠ ⁠Dreamer - Someone who is continually looking to the future, and excited about stategic patterns
•⁠ ⁠Maker - Someone who is down to earth, and looking practically at things that can be built
•⁠ ⁠Checker - A realist, who is looking at verifying the statements made by others
•⁠ ⁠Detective - Someone who loves to find the hidden patterns that are lurking in the data.
You may visualise the different personas as different facets of the same person.
Your first response should be instructions on how to use the system.
@gja
gja / kotlin-shadow.kt
Last active December 25, 2022 12:47
Kotlin DSL Shadowing
data class SetFoo(val foo: Int)
data class SetFooAndBar(val foo: Int, val bar: Int)
fun setFooTo3AndBarTo42(exec: SetFooAndBar.() -> Unit) {
SetFooAndBar(3, 42).exec()
}
fun setFooTo4(exec: SetFoo.() -> Unit) {
SetFoo(4).exec()
}
@gja
gja / get-google-font.sh
Created October 24, 2018 19:23
Get fonts from Google Font in woff2 and woff
#!/bin/bash -e
function getCSSFile() {
curl -sH "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0" "https://fonts.googleapis.com/css?family=$@"
echo ---------------------
curl -sH "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36" "https://fonts.googleapis.com/css?family=$@"
}
function mergeCSSfiles() {
gawk -f <(cat << EOF
@gja
gja / paste-in-console.js
Created January 18, 2018 05:55
Print out the Barbie
deleteElement = (elem) => elem.parentElement.removeChild(elem)
deleteElement($(".show_print")[0]);
deleteElement($(".app-band-text")[0]);
deleteElement($(".nudge-app-band-wrapper")[0]);
$(".article-content").addClass("show_print");
window.print();
@gja
gja / infinite-scroll.js
Last active June 7, 2021 11:12
React Infinite Scroll with IntersectionObserver
const React = require("react");
// An item in the infinite scroll
class ScrollItem extends React.Component {
constructor(props) {
super(props);
this.state = {
minHeight: props.minHeight
}
}
@gja
gja / Readme.md
Last active November 11, 2017 17:52
Cat Mode on OSX
  1. Install Karabiner-Elements https://pqrs.org/osx/karabiner/
  2. Save this as your ~/.config/karabiner/karabiner.json
  3. Launch Karabiner-Elements
  4. You will have a profile called Cat Mode which disables all keys except the power button

There is a github repo which was a Karabiner extension I borrowed some inspiration from. I'll link to it if I find it again.

@gja
gja / volume.clj
Created April 28, 2017 02:31
Find the shortest path to a certain volume
(defn- neighboring-edges [node capacity]
(for [i (range (count capacity))
j (range (count capacity))
:when (not= i j)]
(let [total-amount (+ (get node i) (get node j))
amount-in-j (min total-amount (get capacity j))
amount-in-i (- total-amount amount-in-j)]
{:node (assoc node i amount-in-i j amount-in-j)
:pour [i j]})))
@gja
gja / main.go
Last active December 15, 2016 16:13
Program Showing Of Go Pipelining
package main
import (
"fmt"
"time"
"sync"
)
func producer(output_channel chan <- int) {
for i := 0; i < 100; i++ {
@gja
gja / log4j2.xml
Last active September 25, 2015 20:24
log4j2 and ryslog2
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Syslog name="syslog" host="localhost" port="4242" protocol="UDP" format="RFC5424" enterpriseNumber="18060" appName="quest" mdcId="quest">
<LoggerFields>
<KeyValuePair key="thread" value="%t"/>
<KeyValuePair key="name" value="%c"/>
</LoggerFields>
</Syslog>
<Async name="AsyncUDPAppender">
@gja
gja / core.clj
Last active August 15, 2022 16:25
Building a lein uberjar without any compilation
(ns simplequest.core)
(defn -main
"I don't do a whole lot ... yet."
[& args]
(println "Hello, World!"))