Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
if [ ! -f ./jdk-23.0.1.jdk/Contents/Home/bin/java ]; then
curl -o java.tar.gz https://download.oracle.com/java/23/latest/jdk-23_macos-aarch64_bin.tar.gz
tar -xvf java.tar.gz
rm java.tar.gz
fi
if [ ! -f ./gluegenpatched ]; then
if [ ! -f ./jogl-all.jar ]; then
#!/bin/sh
# check if ~/cache exists
if [ ! -d ./cache/https/game.havenandhearth.com/java/jogl/current/jar/ ]; then
echo "Cache doesn't exist, first try to run haven"
osascript -e 'display dialog "Please run Ender first before continuing." buttons {"OK"} with title "Haven Required" with icon caution'
exit 1
fi
curl -o jogl.7z https://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
@Razikus
Razikus / joglupdatemacos.sh
Created November 1, 2024 12:40
Update haven jogl libraries
#!/bin/sh
# check if ~/cache exists
if [ ! -d ~/.cache/haven-launcher/cache/https/game.havenandhearth.com/java/jogl/current/jar/ ]; then
echo "Cache doesn't exist, first try to run haven"
osascript -e 'display dialog "Please run Haven first before continuing." buttons {"OK"} with title "Haven Required" with icon caution'
exit 1
fi
curl -o jogl.7z https://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
@Razikus
Razikus / havenrun.command
Created November 1, 2024 11:06
havenrun.command
#!/bin/sh
cd "$(dirname "$0")"
# check if jdk-23.0.1.jdk exists
if [ -d "./jdk-23.0.1.jdk" ]; then
echo "JDK 23.0.1 already downloaded"
else
curl -o java.tar.gz https://download.oracle.com/java/23/latest/jdk-23_macos-x64_bin.tar.gz
tar -xvf java.tar.gz
rm java.tar.gz
@Razikus
Razikus / build.sh
Last active August 2, 2024 19:44
Golang build for all distros all archs and with static versions
#!/bin/bash
VERSION=${VERSION:-devbuild}
COMMIT=${COMMIT:-$(git rev-parse HEAD | head -c 8)}
BUILDTIME=$(date +%s)
LDFLAGS="-X 'main.VERSION=${VERSION}' -X 'main.BUILDTIME=${BUILDTIME}' -X 'main.COMMIT=${COMMIT}'"
# go tool dist list
@Razikus
Razikus / index.ts
Created June 23, 2023 07:48
Supabase immudb vault hook
// Follow this setup guide to integrate the Deno language server with your editor:
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
import { serve } from "https://deno.land/[email protected]/http/server.ts"
import * as postgres from 'https://deno.land/x/[email protected]/mod.ts'
console.log("FUNCTION VAULTSIGN LOADED")
const databaseUrl = Deno.env.get('SUPABASE_DB_URL')!
const secret = Deno.env.get('APIKEY_SECRET_INTEREXCHANGE')!
@Razikus
Razikus / vault.py
Last active November 15, 2023 19:27
Immudb Vault Simple Example
import requests
API_KEY = "YOUR API KEY"
resp = requests.put("https://vault.immudb.io/ics/api/v1/ledger/default/collection/default/document", headers = {
"X-API-KEY": API_KEY,
"content-type": "application/json"
}, json = {
"reddit": "Welcome!"
@Razikus
Razikus / pagination.py
Last active November 15, 2023 19:26
Simple pagination in immudb
from immudb.client import ImmudbClient
import uuid
MAX_N = 2000
def main():
client = ImmudbClient("localhost:3322")
client.login("immudb", "immudb", "defaultdb")
client.sqlExec("""CREATE TABLE IF NOT EXISTS pagination( ID INTEGER AUTO_INCREMENT, VALUE VARCHAR[255], PRIMARY KEY(ID) )""")
for index in range(0, MAX_N):
print("Adding records...", index, f"{round((index / MAX_N) * 100, 2)}%")
@Razikus
Razikus / main.py
Last active July 6, 2022 17:33
immudb example for creating table with index
from immudb import ImmudbClient
import time
class ExampleClient:
def __init__(self, immudbUrl, login, password, database):
self.immudbUrl = immudbUrl
self.login = login
self.password = password
self.database = database
self.client = ImmudbClient(immudbUrl)
version: '2'
services:
traefik:
build:
context: traefik
dockerfile: Dockerfile.template
command:
- --entrypoints.web.address=:80
- --providers.docker=true
- --providers.docker.exposedbydefault=false