Skip to content

Instantly share code, notes, and snippets.

View deividaspetraitis's full-sized avatar

Deividas Petraitis deividaspetraitis

View GitHub Profile
package main
import (
"fmt"
"encoding/json"
"reflect"
)
type circle struct {
Radius float64 `json:"radius"`
package main
import (
"fmt"
"time"
"runtime"
)
func main() {
package main
import (
"fmt"
"time"
"runtime"
"context"
)
func main() {
@deividaspetraitis
deividaspetraitis / flash.sh
Created July 10, 2022 09:44 — forked from nicinabox/flash.sh
Find the Pro Micro serial port automatically and flash it
#!/bin/bash
# Usage
# ./flash.sh path/to/your.hex
TARGET=$1
ls /dev/tty* > /tmp/1
echo "Reset your Pro Micro now"
@deividaspetraitis
deividaspetraitis / madox2vim-ai.diff
Created July 19, 2023 08:28
Path for madox2/vim-ai to work with Azure AI.
diff --git a/py/chat.py b/py/chat.py
index 93d31bf..1980681 100644
--- a/py/chat.py
+++ b/py/chat.py
@@ -69,7 +69,7 @@ try:
**openai_options
}
printDebug("[chat] request: {}", request)
- response = openai_request('https://api.openai.com/v1/chat/completions', request, http_options)
+ response = openai_request('https://engineering-ai.openai.azure.com/openai/deployments/engineering/chat/completions?api-version=2023-03-15-preview', request, http_options)
@deividaspetraitis
deividaspetraitis / lcd_tx_pagination.sh
Last active June 30, 2025 07:28
LCD TX Pagination
#!/usr/bin/env bash
BASE_URL="https://lcd.archive.osmosis.zone/cosmos/tx/v1beta1/txs"
LIMIT=100
ORDER_BY="ORDER_BY_DESC"
QUERY="message.sender='osmo1z89utvygweg5l56fsk8ak7t6hh88fd0au3z2n6'"
PAGE=1
while true; do