This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ollama import Client | |
import os | |
# derived from https://github.com/ollama/ollama-python | |
host = os.getenv('OLLAMA_HOST', 'http://localhost:11434') | |
client = Client(host=host) | |
response = client.chat(model='llama3.1:8b', messages=[ | |
{ | |
'role': 'user', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"github.com/ollama/ollama/api" | |
. "github.com/stevegt/goadapt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
winid=$(getwinid) | |
while true | |
do | |
inotifywait -r -e modify * | |
sleep 1 | |
go vet || continue | |
wmctrl -ia $winid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo "Usage: $0 <paths-to-watch>" | |
exit 1 | |
fi | |
# get current window id | |
window_id=$(xdotool getactivewindow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Single line comment | |
/* Multi- | |
line comment */ | |
// A package clause starts every source file. | |
// Main is a special name declaring an executable rather than a library. | |
package main | |
// Import declaration declares library packages referenced in this file. | |
import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# makekey.py - A key making tool | |
# This program will accept a pin configuration for a Schalge 5 Pin lock and produce GCode to mill out the corresponding key. | |
# | |
# For example, this will produce a bump key: | |
# $ ./makekey.py 99999 | |
# | |
# This could produce a key to something else: | |
# $ ./makekey.py 38457 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script atan2 { | |
input y = 1.1; | |
input x = 1.1; | |
# approx from wikipedia | |
plot atan2 = 2 * atan(y/(sqrt(sqr(x) + sqr(y)) + x)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
repo_root=$(git rev-parse --show-toplevel) | |
current_branch=$(git rev-parse --abbrev-ref HEAD) | |
twig=$(basename $current_branch) | |
usage() { | |
echo "Usage: $0 [-cFn] [-b BASE_BRANCH] [OTHER_BRANCH] | |
With no arguments, compare $current_branch with other branches named "'*'"/$twig. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"os" | |
"regexp" | |
"strings" | |
"text/template" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph docker { | |
rankdir=LR; | |
io [label="I/O"]; | |
subgraph cluster_20 { | |
label=journal; | |
// open [label="open\nexisting\njournal"]; | |
notify [label="start\nprocess"]; | |
create [label="create\nnew\njournal"]; |
NewerOlder