Skip to content

Instantly share code, notes, and snippets.

View dimitardanailov's full-sized avatar

Dimitar Danailov (a.k.a Mitco) dimitardanailov

View GitHub Profile
@dimitardanailov
dimitardanailov / AGENTS.md
Last active August 21, 2026 12:52
Codex configurations

Project-specific instructions

  • Never print secrets from .env.
  • Before changing migration logic, inspect the existing source and tests.
@dimitardanailov
dimitardanailov / settings.json
Created August 21, 2026 06:41
~/.claude/settings.json. The configuration follows: https://code.claude.com/docs/en/settings
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"model": "sonnet",
"effortLevel": "medium",
"autoCompactWindow": 400000,
"fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"],
"preferredNotifChannel": "terminal_bell",
"awaySummaryEnabled": true,
"permissions": {
"allow": [
@dimitardanailov
dimitardanailov / bulgarian.md
Last active June 9, 2025 10:14
Instructions - Varna

Обяснение на предназначението на клемите

Клема Предназначение Настройка и обяснение
R, S, T / Y, W Захранване на инвертора: 380V модел, свързан към 5, 1; 220V модел, свързан (потвърдете етикета на клемата). Изход на инвертора, свързан към двигателя. Въздушен прекъсвач трябва да се използва като устройство за защита от свръхток в предния край на входното захранване на инвертора. Ако е добавен прекъсвач за защита от утечка, за да се предотврати неговото задействане, моля, изберете устройство с чувствителност 200mA или повече и време за действие 100ms или повече. За намаляване на тока на утечка, кабелът за свързване на двигателя не трябва да надвишава възможно най-много.
Заземяване Инверторът трябва да бъде добре заземен.
X1 Цифров вход 1 Настройва се чрез параметър F5.2, фабричната настройка е за въртене напред.
X2 Цифров вход 2 Настройва се чрез параметър F5.03, фабричната настройка е за въртене назад.
X3 Цифров вход 3 Настройва се чрез
@dimitardanailov
dimitardanailov / delete-index.js
Created February 17, 2022 16:12
ElasticSearch: Delete an index
'use strict'
const {Client} = require('@elastic/elasticsearch')
const client = new Client({node: 'http://localhost:9200'})
client.indices
.delete({
index: 'audit-*',
})
.then(
@dimitardanailov
dimitardanailov / signTxn.js
Created February 12, 2022 07:16
Algorand sign transaction
signTxn(sk: Uint8Array) {
// construct signed message
const sTxn: EncodedSignedTransaction = {
sig: this.rawSignTxn(sk),
txn: this.get_obj_for_encoding(),
};
// add AuthAddr if signing with a different key than From indicates
const keypair = nacl.keyPairFromSecretKey(sk);
const pubKeyFromSk = keypair.publicKey;
if (
@dimitardanailov
dimitardanailov / algorand-transaction.js
Created February 11, 2022 19:39
Algorand transaction
/**
* @resource
* https://github.com/PureStake/api-examples/blob/master/javascript-examples/algod_submit_tx.js
* https://developer.algorand.org/docs/sdks/javascript/#build-first-transaction
*/
export async function pureTransaction() {
const regExp = new RegExp(/\,/, 'g')
const mnemonic = 'final, equal, social, attack, chimney, spend, swear, civil, sad, jungle, dumb, assault, metal, feature, monitor, marriage, fly, depart, ill, shed, burger, census, swift, absent, garlic'.replace(
regExp,
'',
@dimitardanailov
dimitardanailov / algorand-wallet.js
Created January 29, 2022 07:24
Create an Account on Algorand + re-generate the address from public key
import algosdk from 'algosdk'
const createAddress = () => {
const account = algosdk.generateAccount()
const mn = algosdk.secretKeyToMnemonic(account.sk)
console.log('Account Mnemonic:', mn)
console.log('account', account)
const {publicKey, checksum} = algosdk.decodeAddress(account.addr)
@dimitardanailov
dimitardanailov / algorand-wallet-output.md
Created January 29, 2022 07:10
Create an Account on Algorand: Output
Account Mnemonic: couch august visa harbor fit amount blind yellow tent exile resist hurry bone eternal taxi usage moral roast mercy recipe thunder volcano grant able shove
account {
  addr: 'RW6EZIUTLGTG7HSARRGDUX55ZV5OLAS4WNOEIO2DQ4YRITL7TB7QQYFEYQ',
  sk: Uint8Array(64) [
    135, 201,  67, 233, 145, 230,  43,  32, 248,   2, 255,
    250, 238, 211, 110, 251, 166,  12,  54, 205, 155, 239,
    125, 196, 174,  22,  59, 203, 240, 214, 183,  76, 141,
    188,  76, 162, 147,  89, 166, 111, 158,  64, 140,  76,
     58,  95, 189, 205, 122, 229, 130,  92, 179,  92,  68,
@dimitardanailov
dimitardanailov / algorand-wallet.js
Created January 29, 2022 07:00
Create an Account on Algorand
const algosdk = require('algosdk');
const createAccount = function() {
try {
const myaccount = algosdk.generateAccount();
console.log("Account Address = " + myaccount.addr);
let account_mnemonic = algosdk.secretKeyToMnemonic(myaccount.sk);
console.log("Account Mnemonic = "+ account_mnemonic);
console.log("Account created. Save off Mnemonic and address");
console.log("Add funds to account using the TestNet Dispenser: ");
console.log("https://dispenser.testnet.aws.algodev.network/ ");
const {TransactionFactory} = require('@ethereumjs/tx')
const Common = require('@ethereumjs/common').default
const {Hardfork} = require('@ethereumjs/common')
const BN = require('bn.js')
const {ethers} = require('ethers')
const elliptic = require('elliptic')
const ec = new elliptic.ec('secp256k1')
const sha256 = require('js-sha256')
const fromAddressPrivKey =