Skip to content

Instantly share code, notes, and snippets.

@akirilyuk
akirilyuk / cursor_agent_process.md
Last active May 17, 2026 08:46
How to work with multiple agent session and cursor agent via the shell

Multi-Agent Git Worktree Workflow

A workflow for cloning a repo into a parent directory and using git worktrees to run multiple Cursor CLI agents on separate tasks simultaneously.

Note: This guide is written for the Cursor CLI agent (the terminal-based cursor command), not the Cursor IDE. All examples assume you are working in a terminal.

Directory Structure

@akirilyuk
akirilyuk / overwrite-fetch-discord-proxy.js
Created January 23, 2025 08:49
Overwrite global fetch with discord proxy
const addProxy = (url) => {
if(url.startsWith('data')){
return url;
}
const split = url.split('/');
const proxyIndex = url.includes('://') ? 3 : split[0] !== '' ? 0 : 1;
if (split.length <= proxyIndex) {
return url;
}
const {StaticPool} = require('node-worker-threads-pool');
const task = (array) => {
for (let i = 0; i < array.length; i++) {
array[i] = array[i] ** 2;
}
};
const pool = new StaticPool({
size: 4,
task,
@akirilyuk
akirilyuk / chain-functions.js
Last active September 12, 2022 17:51
Example, how to chain normal functions together with the await keyword in JS/TS to collect data first and execute the request later
const functions = {
data: {},
// we are using normal style function definitons for having a reference to this...
select: function (select) {
console.log('select', select)
this.data.select = select
return this
},
eq: function (eq) {
console.log('eq', eq)
@akirilyuk
akirilyuk / gist:0fee177ad43d2e877ef8b8f675ae4f81
Created January 21, 2022 16:19
jambonz-cognigy-api-contract-session-next-turn
{
"session": {
"synthesizer": {
"voice": "string",
"language": "string",
"vendor": "azure|google",
"azure": {
"ttsDeploymentId": "string containing custom voice"
},
"google": {
ACCOUNTID='ACCOUNTID' && USERNAME='ADMIN_USERNAME' && PASSWORD='PASSWORD' && \
DOMAIN=$(curl --location --request GET "http://api.liveperson.net/api/account/$ACCOUNTID/service/agentVep/baseURI.json?version=1.0" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' | jq -r '.baseURI') \
&& AGENTVEPLOGIN="https://$DOMAIN/api/account/$ACCOUNTID/login?v=1.3" \
&& BEARER=$(curl --location --request POST "https://$DOMAIN/api/account/$ACCOUNTID/login?v=1.3" \
--header 'Content-Type: application/json' \ --header 'Accept: application/json' \
--data-raw "{\"username\":\"$USERNAME\", \"password\":\"$PASSWORD\"}" | jq -r '.bearer') && echo $BEARER
const credentials = {
username: 'testName',
password: 'testPassword',
};
const exampleProjectId = 'myTestProjectId';
const exampleConversationId = 'myTestConversationId';
const exampleConsumerId = 'myTestConsumerId';
let constructorCalled = 0;
let authenticateCalled = 0;
const storage = {};