Skip to main content

Posts

Agent Orchestration with VS Code and GitHub Copilot (Local Agents Only)

Agent Orchestration with VS Code and GitHub Copilot (Local Agents Only) Agent orchestration is becoming a key pattern in AI-assisted development. Instead of relying on a single assistant, developers can coordinate multiple specialized agents that collaborate to complete complex workflows. This article focuses strictly on local agents within GitHub Copilot in Visual Studio Code. It does not cover background agents or cloud agents. Scope of this article: Local agent capabilities in VS Code Agent handoff for orchestration Use of skills Reference implementation Focus on Local Agents Local agents operate entirely within the VS Code environment. Characteristics Execute inside the editor session Provide fast, interactive responses Work with local files and context No dependency on external execution pipelines Why Local Agents Immediate feedback loop Better developer control Ideal for iterative workflows Lower complexity compared to distributed systems Key idea: Local agents are sufficient to ...

Three ways to use user defined vscode snippets

What are code snippets? Code snippets are templates that make entering repeated code patterns, such as loops or conditional statements,  easier. Types of snippets Built-in snippets   Vscode has built-in snippets for number of languages like PHP, Javascript, Typescript etc . Snippets available on market place   There custom snippets averrable on marketplace for specific frameworks / languages and platforms as well. For example snippets for VUE, Laravel etc. User defined snippets  You can defined your own snippets, It's called user defined snippets. You can create snippets according to your need using the snippet templates.

Use google cloud log-sink to log incidents to your project management system

Small team working on multi service product, With carrying more then one responsibilities. It's a big challenge to keep everything on track. Most importantly, When it comes to incident reporting. We can not automate every thing but, at least we can automate incident reporting to our project management service eg Gitlab / GitHub / Slack. ( Slack 😅 , for small team like us slack also work like project management tool. ) Google cloud log-sink Here comes google cloud log-sink handy to you. We can direct all of your logs with severity level of Error Crtitical Alert Emergency to a logs ink which log a incident on your project & issue tracking service ( For example Gitlab ) using cloud pub/sub topics. [ You can use firebase function for such pub/sub topics ] Inclusion filter for error logs severity='(ERROR OR CRITICAL OR ALERT OR EMERGENCY)' Next time when ever error log will be generated on your cloud logs. You will get an incident created on your gitlab. So Don't wait...

Transpile your mithril jsx using babel's online transpiler

You can transpile your JSX based mithril component to mithril component online with help of babeljs. Goto https://babeljs.io/repl Copy your JSX component over there. Select React and ES2015 in preset for compilation. You will be getting compiled code on the right side. If you notice this compiled code is for React, and not for the mithril. You have to go one step more, Replace all the React.createElement with m and you got the code for your mithril. Cheers!

Gitlab CI/CD for firebase project

CI/CD stands for continues integration, continuous deployment.  Normally, I am hosting my private projects on Gitlab. One of my project is implemented on google's firebase platform. It's using firebase functions, hosting, pub-sub and other google service heavily.

Google blogger Ideas panel

Google blogger Ideas  I opened by blogger today, and..   I got this.  Google blogger Ideas  A panel suggesting a topic on which I can write my next blog. It's fetching unanswered question from web according to your previous post and topics. It was something, I was really looking for, after all it takes time to finding subject on which to write next and still being in the same niche.  Awesome feature Blogger! 

Immutable.js with firebase

To store data we can use either object or we can use array in javascript. Both have their own advantage and disadvantage. Array : Array has advantage of maintaining order, but negative side is that If you want to update any element inside array you have to find the index of the element. May be via looping through the whole array if indexes are not predictable. Object : You can store element as object property. It's like key-value pair, So If you want to update any property (element) of object, you can update it easily using key. So, It's easy to update the elements in object, but object uses hash for property, So order is not guaranteed. Immutable.js with firebase Firebase provides live updates. Suppose you are having a program where you are listening for live updates on some last x elements, while retaining others for display only, but order of display matters.  You are listening for last x elements live, So you have to update the data of those elements when you receive upd...

Ahmedabad Shopping festival

Ahmedabad Shopping festival is solution created by  Tuzzin Infotech Pvt. Ltd . I worked as part of the development team My journey started as a part-time web developer. A MySQL database, Php for backend, VueJs and jQuery frontend, scss for css and I'm done. So easy! I was never thinking about scaling, rate limiting, timeout on those days, and normal site even does not need to care about such things unless they reaches that threshold. Luckily, I got chance to work on a product which was requiring all of this. It was the first time when I got exposure to real scalable application with spike in traffic, Ahmedabad Shopping festival 2019.   Brief Intro of Ahmedabad Shopping festival  Ahmedabad Shopping festival was first digitally managed shopping festival of India hosted in Ahmedabad, Gujarat. Every customer were getting rewards and coupons for chance to win prize on making shopping during shopping hours . Technical requirements Ahmedabad Shopping festival was con...

Creating 2d games with golang and gontuz/prototype

Golang was created as server language. But with the time and curiosity of people, golang has covered GUI application and game development as well. I am sharing here one of the available golang library, on top of which you can create 2d games. Its gonutz/prototype . Sample video Gonutz/prototype is very small and easy to learn library. It's cross-platform , that means the game your are creating in one platform will be able to run on other platforms without any change in code ( in normal case ).  This package currently supports windows , mac and linux. gonutz/prototype features Support for keyboard input Support for mouse input Support for 2d drawing Support for image and sprite-sheets Support for sound  Want to learn more about this package.  Follow my youtube video playlist "2d game development in golang" Video tutorial playlist:   https://www.youtube.com/playlist?list=PLub5C2vM5SjJIF0f561mAON7nFG2nKHD9

Go-boiler : smaller and simplest starter kit

Project Name  Go-boiler Project Descrtiption Simple, small & easy to get started boiler-plate(starter-kit) written in golang for creating website/webapps. External libraries Cloudykit/Jet ( HTML templating engine) gorilla/mux ( HTTP Routing ) gorilla/csrf ( CSRF ) Source code https://github.com/mchampaneri/go-boiler Documentation https://mchampaneri.github.io/go-boiler

Customize Scrollbar look

You can customize the look of scrollbar using CSS. Here is a snippet of sample custom scrollbar UI, ( I have introduced  : hover   because I want to show scrollbar on an element only when user hover on that element ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 *: :-webkit-scrollbar { width : 5px ; display : none ; background-color : #666666 ; } * :hover : :-webkit-scrollbar { width : 5px ; display : block ; background-color : #666666 ; } *: :-webkit-scrollbar-track { background : #ddd ; } *: :-webkit-scrollbar-thumb { background : #666 ; border - radius : 20px ; }

YTDownload ( Server )

Project Name YTDownload Project Descrtiption YTDownload ( Server ) is a server-based application. Its aim is to download video from youtube in all format and qualities provided by youtube. It uses a web browser for its UI. The core logic of the server is written in goLang. External libraries & dependcies VueJS ( JavaScript FrameWork ) Spectre ( Css FrameWork ) YTDL ( GoLang Youtube download Library ) Gorilla Mux ( GoLang HTTP Routing Library ) Pros It's a server-based application. So you just have to start the server and you will be able to use it from any device having a browser and connected to the same network using local address of the server. No need to install Cons Downloads with a single thread, so downloading speed will be less than those other downloaders provides. Can not use without the local server running. No mobile platform for the server is supported Source code https://sourceforge.net/projects/ytdownloader-xyz/ Download link ...

Datastore : Handling heavy insertions

Note: This is a case study to share what I faced, this might not be new to you and may have a better solution then I find. (You can share you solution here 😊) .  At first sight, datastore looks very easy to work with. And it is if insertions have to be done at a low rate. But when insertions are done at a high rate you come to find out certain issues which are not because your program is faulty but because you don't read the ( long detailed ) documentation of datastore, that itself has certain restrictions you might never hear before. Timeout Problems There are two kinds of timeouts 1. Call error 11: Deadline exceeded 2. API error 5 (datastore_v3: TIMEOUT) Call error 11: Deadline exceeded This kind of time out happens when your datastore operation takes time more than 60 sec to finish the operation.  For example, you are inserting too much data with a putMulti function. That takes time more then 60s insert. API error 5 (datastore_v3: TIMEOUT) This mos...

Cursor based navigation for datatable

I was working on a module where data was comming from datastore and paginated using cursor. If you are not familier with datastore, then you can refer to this link . In case of datastore we just have cursor to get next set of data. Though there is offset availabe in datastore its costly. So to be cost effective we have only option available is cursor. Datastore decodes cursor and in response returns data associated with that cursor. Now, If you are using bootstrap data-table you might find it cofusing that how to pass the cursor to your queryparameter. Even I still don't get answer of how I can change data-queryparamter dynamically to update cursor on the url. But instead I got another simple solution. HTML Snippet <table id= "table" data-toggle= "table" > <thead> <tr> // your data table fields </tr> </thead> <tbody></tbody> </table> <nav aria-label= "Page ...

datastore to bigquery data export

Google Cloud Provides a ready made script to run scheduled export from datastore. I am using that export data as input to BigQuery. To get it done, I had created two crons, First for calling data export operation Second for loading that exported data to BigQuery Problem I was facing was that export was taking some time more time than I have assumed, So Bigquery loading cron was getting initiated before data export opertion get completed, and result bigquery loading was failing. Solution was to make those two cron job as a single one which works as chain. On successful completion of task one second gets called. So, I just modified the schedule export script provided by google, which exports files, and then checks if operation is successfully done or not fixed time intervals in loop, and if operation is found to be done successfully, it calls BigQuery load task. Here is gist 

partial search with firestore

You can provide partial search [ type ahead facility ] with firestore. It's not that much streight forward and also not feasible in case of large amount of data that has to support the partial search. Here is just a sample of how you provide partial search with firestore. Logic behind the search is a custom kind of indexing that enables partial search for us. You need to create a collection of documents called indexes which contains indexes generated for the fields you want to search over. First reqirement is to create every possible partial search strings. Below function returns array of the possible indexes generate after chopping out input string character by character. /* storing searchabel fields */ function _chopped_object(iString) { var searchables = {} for (i = 0; i < iString.length; i++) { var string_part = iString.substr(0, iString.length - i) searchables[string_part] = true } return searchables } Output of _chopped_o...

Creating nested documents in firestore

Firestore returning no records yet, I see them in console Collection not retuning any element. ... ...  You might facing issues written above. Then it might be this case. You might getting empty response in this kind of query though there are elements in firestore. db.collection(collection1).doc(doc1) .collection(collection2).doc(doc2) .collection(collection3).get() .then( function (querySnapshot) { querySnapshot.forEach( function (doc) { console.log(doc.id, " = " , doc.data()); } ) I face the same problem. Though data was stored sucessfully ( I was guessing, which was wrong actully ) .  To verify that your data is not stored as you expceted you can do check this. Key in italics font means element is deleted If key of your data is in italic font then your data is not stored or is marked as deleted [ that was happening in my case ]. See in image. Now you might thinking, that I have created element and  not del...

Upload Files to Firebase Storage with dropzone.js

Almost every file uploader I found on web are expecting url to where we want to upload file. If you are using firebase storage then you will find this awkward as you don't have any rest url where you have to upload file .  Instead, file upload handled by firestore library firebase-storage. After certain effort I found a way to use dropzone.js with firebase storage. Here is some snippet of code which you may find useful, If you are in the same situation as I am. This both function are in same file Dropzone configuration.. ( in index.js ) var myDropzone = new Dropzone( "form#dropzone" , { // Make the whole body a dropzone url : '/' , addRemoveLinks : true , method : 'put' , chunking : true , forceChunking : true , autoQueue : false , autoProcessQueue : false }); myDropzone.autoDiscover = false ; myDrop...