Skip to content

Instantly share code, notes, and snippets.

The goal of this worfklow is to make the process more intentional and reliable. Agents are slow, for an agent to properly do the job it needs to go and gather enough context, do the research, it doesn't make sense the be interrupted by agent finishing his job half way to ask for user intervention.

The work should be intentional or be completely automated, nothing in between. Almost is a bitch. That means the agent should work with me to come up with a spec. For small well defined things I might finish the spec myself, for others there might be more back and forth, for third it might require a whole research to compare multiple approaches then my decision and only after that the implementation.

Plan mode - my full attention

Plan mode is the moment when you have my full attention, I'm fully immersed, working on a single thing. At that point we should figure out the plan what to build, if I didn't specify that, research questions draft the implementation, sudocode or very light implementation ex

Use modules organised by business logic features, not by underlying functionality

Good example

user/userSlice.ts user/userPage.ts user/userAvatarComponent.ts

Bad example

utils/userUtils.ts components/userAvatar.ts pages/userPage.ts

import {
getContract,
keccak256,
toHex,
encodeAbiParameters,
parseAbiParameters,
pad,
encodePacked,
} from "viem";
import { Address, prepareWriteContract } from "@wagmi/core";
{
"redirects": [
{
"source": "/(.*)/",
"destination": "/$1",
"permanent": true
},
{
"source": "/index.html",
"destination": "/",
// import { Address } from "@ton/core";
import { JettonsService } from "../../jettons/jettonsService";
import { WalletService } from "../../wallet/walletService";
import { PROXY_TON, Web3TransportService } from "../../web3infra/web3TransportService";
import { zeroTONtopTON } from "../../web3infra/zeroTONtopTON";
import { Asset, Factory, MAINNET_FACTORY_ADDR, PoolType, VaultNative, ReadinessStatus, JettonRoot, VaultJetton, Pool } from '@dedust/sdk';
import { Address, OpenedContract, Sender, toNano, TonClient, TonClient4, WalletContractV3R1, WalletContractV4 } from "@ton/ton";
import { SimulateSwap, Swap } from "../swapService";
export class Dedust {
# Transfer
# Transfer swap
async transferSwap(userId: number, accountIndex: number, params: { swapTxParams: SwapTxParams }) {
const { swapTxParams } = params;
const [connectedWallet, secretKey] = await Promise.all([
await this.walletService.getTONWallet({
userId,
accountIndex
}),
@satanworker
satanworker / .eraseToEffect vs .catchToEffect.swift
Created May 29, 2023 19:28
`.eraseToEffect` - когда нужно схлопнуть несколько операторов в один эффект, чтобы компилятор не отъехал
func testAsyncEffect() -> Effect<Int, MainError> {
Effect<String, MainError>.future { callback in
DispatchQueue.global().async {
sleep(5)
callback(.success("All good"))
}
}
.flatMap { value -> Effect<Int, MainError> in
Effect.result {
.success(2)
@satanworker
satanworker / FlatMap.swift
Created May 29, 2023 19:27
`flatMap` на вход приходит (String) и на выход `Effect(result)`
func testAsyncEffect() -> Effect<Int, MainError> {
Effect<String, MainError>.future { callback in
DispatchQueue.global().async {
sleep(5)
callback(.success("All good"))
}
}
.flatMap { value -> Effect<Int, MainError> in
Effect.result {
.success(2)
@satanworker
satanworker / ERC20.t.sol
Created May 13, 2022 08:04
Foundry dealing custom ERC20
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.10;
import "../../lib/ds-test/src/test.sol";
import "../../lib/forge-std/src/Vm.sol";
import "../../lib/forge-std/src/Test.sol";
interface ERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address tokenOwner) external view returns (uint balance);
@satanworker
satanworker / carousel.swift
Last active September 24, 2022 14:31
SwiftUI full width carousel