Skip to content

Instantly share code, notes, and snippets.

;;=============== play with flow ==============
(require '[clojure.core.async :as async]
'[clojure.core.async.flow :as flow]
'[clojure.pprint :as pp])
(defn monitoring [{:keys [report-chan error-chan]}]
(prn "========= monitoring start")
(async/thread
(loop []
(let [[val port] (async/alts!! [report-chan error-chan])]
@VincentSchmid
VincentSchmid / justfile
Last active January 17, 2025 19:21
justfile for terraform configuration
terraform_version := "1.6.6"
current_env := "dev"
var_file_name := "./configuration." + current_env + ".tfvars"
backend_file_name := "backend." + current_env + ".tfvars"
terraform_loglevel := "ERROR"
terraform_code_folder := "terraform"
# runs terraform init & fmt & validate & tflint (add -reconfigure or -upgrade as params)
tf-check *params:
@disler
disler / README.md
Last active January 17, 2025 19:15
Use Meta Prompting to rapidly generate results in the GenAI Age

Meta Prompting

In the Generative AI Age your ability to generate prompts is your ability to generate results.

Guide

Claude 3.5 Sonnet and o1 series models are recommended for meta prompting.

Replace {{user-input}} with your own input to generate prompts.

Use mp_*.txt as example user-inputs to see how to generate high quality prompts.

@svyatogor
svyatogor / broadlink_to_tuya.py
Last active January 17, 2025 19:02
Convert SmartIR Broadlink commands to Tuya
@jpetitcolas
jpetitcolas / gist:5967887
Created July 10, 2013 16:37
Encode/decode a base64 encoded string in PostGreSQL
-- Decoding
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table;
-- Encoding
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table;
@ranftlr
ranftlr / loss.py
Last active January 17, 2025 18:57
def trimmed_mae_loss(prediction, target, mask, trim=0.2):
M = torch.sum(mask, (1, 2))
res = prediction - target
res = res[mask.bool()].abs()
trimmed, _ = torch.sort(res.view(-1), descending=False)[
: int(len(res) * (1.0 - trim))
]
@TheEnmeiRyuuDev
TheEnmeiRyuuDev / TT_Hunter_v2.1
Created April 9, 2024 20:57
T.T. Hunter for TlsContact, 1-line version
/*
* T.T. Hunter,
* -- hunts a TLS appointment.
* @version: 2.1
* @author:
* https://www.termin-tracker-all.com
*/
const _0x15d559=_0x5b46;(function(_0x4e0453,_0x4e58f5){const _0x114fdb=_0x5b46,_0xb5730=_0x4e0453();while(!![]){try{const _0x17655c=parseInt(_0x114fdb(0x24b))/0x1+-parseInt(_0x114fdb(0x1f9))/0x2*(-parseInt(_0x114fdb(0x238))/0x3)+-parseInt(_0x114fdb(0x1f3))/0x4+-parseInt(_0x114fdb(0x26a))/0x5*(parseInt(_0x114fdb(0x21d))/0x6)+parseInt(_0x114fdb(0x20c))/0x7*(parseInt(_0x114fdb(0x202))/0x8)+parseInt(_0x114fdb(0x225))/0x9*(parseInt(_0x114fdb(0x1e8))/0xa)+parseInt(_0x114fdb(0x21a))/0xb*(-parseInt(_0x114fdb(0x1e9))/0xc);if(_0x17655c===_0x4e58f5)break;else _0xb5730['push'](_0xb5730['shift']());}catch(_0x3d95ad){_0xb5730['push'](_0xb5730['shift']());}}}(_0x2d23,0xa6323));const centerInfo={'TlsGermanyRabat_FamilyVisit':{'code':_0x15d559(0x251),'country':'de','aptType':_0x15d559(0x256),'issueCountry':'ma'},'TlsGermanyRabat_Tourism':{'code':_0x15d559(0x251),'country':'de','aptType':_0x15d559(0x242),'issueC
@AreYouLoco
AreYouLoco / dns_forpsi.sh
Last active January 17, 2025 18:55
Posix script to use acme.sh with forpsi.com - DNS API
#!/usr/bin/env sh
# FORPSI DNS API for acme.sh
# Based on https://gist.githubusercontent.com/patrikbeno/29b5e2746367acf0e1b587e02b8b3a50/raw/1e39790e1bc3e5455eb0e7d08abaa412de07d3b7/dns_forpsi.sh
# And modified by (me) Orest Worhacz with the help of ChatGPT
# Works! It could be easily adapted to forpsi.sk/.cz/.pl
# Usage: ./acme.sh --issue --dns dns_forpsi -d site.example.com
username="username"
password="password&1"
domain_id="12345"