Heyo! These so called "AI" is everywhere these days. This blog is to show all the ways I personally make use of these things. I've been meaning to write this blog for quite some time as I've heard a lot of people saying something along the lines of "I kinda get how this work, but I don't know what to use it for". I'm no expert by any means, but...
Hello Gophers and other beings of the world wide web. The context package is something all Gophers would have used at some point in their life, but do you know what looks like inside(because apparently the real beauty is on the inside)? If you like this, you can checkout my previous blog post about how sync.WaitGroup work internally here. This is...
One of my colleagues asked this question to a candidate during an interview. Although I've heard it asked many times, this time it felt different. I sat there thinking, "Do I really know how sync.WaitGroup works?" The question was about using it, but I realized I didn't fully understand how it worked internally. This weekend, I took some time to...
A short entry on how you can use bookmark keywords in Firefox to speed up navigating to common pages. Not sure how many folks are aware of this, but Firefox lets you create “keywords” for bookmarks which can be used to directly navigate to a page. For example, if you often go into GitHub notifications page, you can create a bookmark for it and...
Cross-Origin Resource Sharing or CORS is one of those things that I have had to explain to a lot of junior folks. I feel like it is partly because there is a lot of unhelpful and confusing information around it. In this blog, I hope to give a high level overview of what the idea behind CORS is, why it is required and most importantly how to avoid...
I have been using terminals for a long time, initially because I thought they looked cool, and later because I genuinely found them to be easier/faster to get stuff done. And since I've been at it for a while, navigating through directories is something I think I've gotten good at. In this blog, I would like to give some tips on ways you can...
Here is an overview of how I manage my tasks/todos in LogSeq. I do use LogSeq to take notes as well, but I'm not gonna go much into that here. I started getting more into LogSeq, like most people, when I got addicted to endlessly watching those non-productive productivity YouTube channels where they switch their note taking app every week and...
Well, I think most of you reading this blog use git more or less on a daily basis, but have you ever looked into what is in the .git folder that git creates? Let's explore it together and understand what is going on in there. This is a blog version of a talk that I recently gave. Unfortunately I can't link to the recording :(. git at a basic...
EDIT: I've since updated the code to support leading commas. You can find that version here Another day, another blog on tree-sitter. Not sure if you have read any of my previous blogs on tree-sitter, but I have a few of them. First, let me show you what this one is about. Here is a recording of the code in action. Video of the code in action...
Hey, this is a quick announcement about my new Emacs plugin, scopeline.el. You can find it here. What is does is something pretty simple, but IMO pretty useful. It shows you what every closing delimiter is actually closing. When you have a large file and you are the end of a function, you might have a lot of closing brackets, one for the...
What do I know? # Before we begin, let me give you an idea of where I am coming from and what my experiences are based on. Just to get it out of the way, I'm currently an Emacs user. That said, I have used a lot of text/code editors, all the way from Notepad to JetBrains IDEs(well, in the past) or even the Borland C++ editor which looked like...
Hey! EmacsConf just concluded and it was a really awesome one this year. A lot of interesting talks. It was a lot of fun interacting with everyone during the event. For folks who where there, "hi again!". If you have read my previous blogs, you might be already aware that I have been playing around a lot with tree-sitter in Emacs. And so, this...
I am a big fan of being able to view the history of places that I have been to. Google location history is great in this regards. It records all the places you and you can view this on Google maps. But for some time now I have been removing Google more and more from my life and one of the first things to go was location history along with search...
Yet another entry for tree-sitter. For those new here, I have blogged previously about using tree-sitter here and here. Here is another installment of how I use tree-sitter to simplify/speed up things for me. In this installment we are going to see how we can use tree-sitter to easily navigate around config files. When having to navigate through...
Tree sitter has been one of those tools that has enabled me to add in a lot of useful features to my dev environment. I have previously written about my Emacs package meain/evil-textobj-tree-sitter which will let you operate on language constructs like functions, classes, loops etc as evil textobjects. I have been playing around with tree-sitter...
First of all, sorry about the clickbait title, but I could not stop myself from using this overused joke. What I wanted to talk about in this article is about Peltoche/lsd. lsd is a rewrite of the classic ls command but with a few new and useful(IMO) features. I am the primary maintainer of this project as of now and thought I would go over some...
I have built up a pretty good workflow in the terminal. The main thing that I was missing until now was an easy way to drag and drop the files that I am looking at in a terminal to other apps. So far, whenever I wanted to share a file from the terminal I would open up a GUI file browser, navigate to that directory, find the file and then drag and...
I use my shell a lot and have a pretty good prompt which I have built up over the years. It has got to a point where I think I have a pretty good setup and don't find the need to tweak things a lot and so I thought I would blog about it. For the uninitiated, a shell prompt is the thing that to see to the left(and right in some cases) of place...
I have recently been playing around with nix a lot. It is a really interesting piece of technology. I haven't figured out most of it, but I have already started looking down on people who don't use it. But yeah, in all seriousness, it seems like a really interesting project. Being a beginner I thought I would write a beginner ish tutorial on nix....
I found myself writing a lot more go these days. So far I like the language even thought it seems way too simple at times. That said, one thing that I found a bit annoying was how I had to write all those default values when we have to return an error. I really liked how Rust handed errors, but yeah. In this article I wanted to introduce a...
Project Url: https://github.com/meain/gh-issues-to-rss Yet another package release coming your way. This is more of a scratch my own itch kinda entry. There are lot of projects for which I would like to know when things happen. As of now, there are two options in Github to do this: Subscribe to just releases releases and be late to the party...
I was a Neovim user for a long time, but I have switch to using Emacs for quite some time now. About 1.5 years. The transition for the most part was pretty smooth except for some initial hiccup. I am now in a state where I as productive or even more when compared to Neovim. So I thought I would write about my experience and what all plugins I...
A simple life hack that I use a lot. I just wanted to mention why I always use a coin toss to choose if I can't decide between two options. There is only two scenarios I am in when I can't decide between two options I know what to pick, but just can't finalize I genuinely have no clue what to pick In the first case, the only thing that is...
Link: https://github.com/meain/evil-textobj-tree-sitter Hey everyone, just wanted to mention about a new package that I released recently. The package name is evil-textobj-tree-sitter and you can find it on my Github. This package provides textobjects for evil-mode using tree-sitter. It helps add textobjects like functions, classes, loops,...
Tests are awesome, but not a lot of people want to write them(myself included at times). This is just a rant type blog and I am probably being really dumb, but I had to get this out there. I just wanted to talk about how we introduce beginners to the idea of writing tests. When I started off my career, I was told that tests were a way for one to...
Well, I have been attending a lot of meetings lately. More than I would like to admit. The number of meetings have gone down compared to the start of the pandemic, but it is still a lot. To be frank, sometimes really you have to talk things through instead of just texting people. OK, with all that aside, let me get to the actual content. I just...
Hello everyone, another installment of me going over my setup. This is one of those things which I don't use all that much but wheneve I do, I really am glad that this is a thing. Video of what I am talking about Let me first explain the feature that I am talking about. I have my editor(Emacs) setup exactly how I want it to be(for the most part)....
Just another, TIL type entry. It is about Airflow. I have been working with Airflow for quite a while. I don't really like it to be frank, but I am stuck with it for now. With all that said, you can do everything that you want to do in Airflow. There is always some way to do everything. If you try really hard, you will be able to find even a way...
I really like markdown. I write everything in markdown be it blogs, presentations, emails, todo lists, documentation, everything is in markdown. For the most part I can parse and render markdown in my head and don't need anything more than a simple text editor that will let me write stuff down. But, from time to time, I do like to render the...
Well, the year is about to end. It was a fun year, no shit. I wanted to write something like this for quite some time. I was like, "too lazy today, tomorrow" and the year is almost over. I did not want to keep this pending for next year and so started working on it. Well, I just wanted to mention a bunch of thing that I have in my workflow to...
OK, so I recently switched over to Emacs just becuse I woke up one day and got the itch to write some lisp. It has been pretty fun so far. Now with that out of the way, let me tell you about what I was actually planning to write about. The idea is to show you a small example of how I am able to hack together stuff in Emacs. I know someone will...
Hey, Been a while since I have wrote a blog and thought I would write about something that I really like, git. I really like git, almost all of my important data is text and almost all of them are versioned using git. Here is a bunch of things in git that I think are not that widely known. Worktree # Worktrees are useful if you work on a bunch of...
Hi, Just another one off blog. I have been using tmux for a while and one main thing I always wanted to have in tmux is a floating scratch terminal. I got so used to this during my time with i3 and wanted to replicate it with just tmux. Check out what I am talking about on Youtube. Code used here: script and tmux-config A while back, tmux...
Let me get this out first. There is small chance that what you need is Kubernetes, but it is highly unlikely. What you need is not Kubernetes. What you need is scaleable deployments. If you haven't already been able to tell, this is more of a rant blog. Just my opinions. Yup, I have them. Let me explain how this went for me. I was dealing with a...
Another random script I pieced together recently. I generally have a bunch of temp folders that I keep around for files to go in. And at times, I have pull some files into the current folder I am working on in my shell. If those are pdf of image files, I usually have them open in macOS preview which btw is a neat tool. Anyhow, when I now have to...
UPDATE: I did run into some pretty good documentation from GitHub here. One caveat is that inorder to remove it from pull requests, you will have to get the GitHub team involved. Another short one. Imagine this situation, you committed a file containing passwords into git accidentally. What do you do? Pretty easy, you just revert that commit. The...
So yeah, this is me trying to write a non technical blog. Not sure how this will end up. This is just an intro, very basics of what I wished I knew when I started off. I am not someone who really knows what I am talking about here, you have been warned. What are they? # Stock options are an agreement that the company that you work for gives you...
Hola¡ I have been doing frontend for a long time. I started off with vanilla JS, then used jQuery and after that moved directly onto using pretty much React. I have tried out a lot of others and most of them seem to have this idea of having the UI as a pure function of your data at the core. I really liked the idea of having your UI as a function...
Another installment of me figuring out more of kubernetes. Full code available at meain/s3-mounter So, I was working on a project which will let people login to a web service and spin up a coding env with prepopulated data and creds. We were spinning up kube pods for each user. All of our data is in s3 buckets, so it would have been really easy...
Here is a simple workflow that I have extracted out into a blog. I generally have a VM on standby to offload some tasks over to that VM instead of running things on my laptop. One main example of this is when I am trying to do some experiment and check if a container still builds after I do some changes. I usually make the changes and offload the...
OK, first of all, let me make sure that you understand what we are trying to do here. Let us say that I have a lot of kubernetes services with names like below. This list may grow or shrink dynamically and is controlled by some other script. I am spinning up a dev instances for each use as they login. Something new I am working on. exper-0...
So yeah, recently I decided to switch from Google to DuckDuckGo. DuckDuckGo is great, don't get me wrong. But at times, Google just has better results. I usually find myself going back to Google for a max of 10%-15% searches. DuckDuckGo is really good, just not creepy good. If DuckDuckGo fails # I am a lazy person, if I have to do the search two...
Hi, another installment of why people should just write more bash. I am not sure if you are aware of it. There is a new shell written in Rust called Nu Shell. One of the main ideas of it is that you treat every data as table data and then work on top if as if you were working with SQL queries. I am not a big fan of this approach personally. I...
You might have seen a lot of colorful blobs everywhere these days. It is simple and looks pretty without much effort. You even have tools like blobmaker.app to help you easily create blobs. Let me show you how you can code up your own svg blob thingy. Here is what we will be building. github and codesandbox OK, here we go. 1. Prepare environment...
Recently I made a mistake of committing a conflict marker and pushing that code to Github. That is when I thought that I could have a easily avoided this if I had added a git-hook to warn me if the code that I commit had conflict markers. Here is how you would set up something like that. What are git-hooks? # In case you are new to git-hooks, it...
This article describes in general how to set up permission for a Pod so that it will have access to Kubernetes API. My exact use case was that, I wanted to run a Pod which will watch a redis queue and then start a job whenever there is a new item in the queue. I will only be explaining how to set up the permissions and I think the rest of the...
Hi, I am gonna let you in on a little secret. Git never forgets what you do, you can mess up however you want and you will still have all your data available*. * as long as you have committed you code and also only for 90 days OK, I am not taking about the fact that you can you can see the logs of what changes you have made over a period of time....
This will not work as of Firefox 72 So, I was going through r/startpages and checking out the startpages there. A lot of them looked pretty awesome and I decided to create one. And create, I did meain/startpage. But yea, setting a local file as startpage is a messy deal in Firefox. Lot of people seem to set up a local server and even after than...
So yeah, you have an amazing app(I am gonna assume it is in python) that you would like to deploy. You know how to deployment works. You spin up an instance on gcloud or aws or azure or somewhere else. You install python, no python3, then pip install requirements.txt. Set up your database, maybe redis. Now you make sure firewall rules are ok if...
tf-serving if you don't know is a tool that Google has built to serve model built using tensorflow. Even keras models with a tensorflow backend should do just fine. Even thought there are a lot of guides on how to use tf-serving, I could not find anything coherent and simple. So I decided to write one, mostly so that next time I have to do this I...
Almost everybody does an ls after they cd into a folder. So why not get your shell to automatically do it? The simple way # Well, you might know the simple way. Just change cd to do cd and ls. cd() { builtin cd "$@";ll;} The grown up way (in zsh) # Well, even though the previous one works well for most cases, there might be some situations in...
We went through some basic stuff you need to understand to configure nginx in an old blog. After writing that I had to work on another project which was a bit messy. So I went over more stuff, and I thought I would write about it. Before going into the blog, let me go in what is the situation that I was in. I had two frontend (static file)...
So, recently I had to create an autocompletion for a chat app at work. We did not need anything fancy for the first cut. Sounded like a simple project. This was in React I initially thought of pulling in an existing library for it, but our requirements needed some special kind of autocompletion menu. Let me tell you what I mean by that. We build...
Yo, I have been working on Rust for some time now. It is a great language and a refreshment coming from a primarily Python and Javascript background. I feel like the compiler has got my back even though it yells at me a lot. I feel like I could refactor something and if the compiler does not complain, nothing will break. But that said, coming...
This is another installment of "this is not a blog but a note for my future reference". Here, I will introduce you to writing a very simple nginx config file. The use case I will go over here assumes you have a directory of static files and a backend running somewhere. Where to put the files # First of all the config file is supposed to be...
Let's say you have a very useful python script that you use and think other people might have some use out of it. One way is to just share the python snippet, but nah, that is too old school. Let us publish it to pypi so that anyone can just do a pip install your-awsome-tool and get going with it. So, how to do it? # Well, let us create a simple...
Hi, the idea here is to introduce you to how docker works in very basic terms. We will go through how to create a docker file and how to run it and stuff like that. But just the basics, just enough to get you started on docker so that you can take on from there by yourself. I am not going to discuss as to how to install docker. Just go and look...
Let us say you went deep in to a highly nested project structure and want to get back to the project root. Sure you could go cd ../, nah not here cd ../../, not here either ..... But there is a much better way to do this. You can leverage git to find where the project root is. git rev-parse --show-toplevel 2> /dev/null This gives you the project...
So, you have been working on your React project. Maybe you have heard about Redux and how it can make it all better and need some help getting started. What is Redux? # Hmm, good question. It is like this master thingy which handles the state of all your components rather than handling the state in the components. So what you do is when you need...
Take a photo every time the lid is open using the laptop camera. Hey, ever seen those time-lapse videos of plants growing up in a BBC documentary and thought wish I could do that for me. You haven't? I knew. But here is how you would do it if you had thought of doing it. ( in OSX ) It also helped me to see who tried to open up my laptop when I...
Whoosh, I am tired of JS all day long, let me try out something else. And yeah, I ended up here. Actually I was kinda playing around with Haskell before I reached here. It feels pretty good to have a change from the usual stuff. To be frank I think everyone should try out functional programming at some point of time. Well, enough bullshit let us...
Well, hey. So, what is Webassembly? # To be blunt and simple it is just assembly on the web. What you do is write in a low level language such as C, C++ or rust(a new language by Mozilla) and convert them into assembly(sort of) language and ship that to browser. Why new stuff though? # Well, JS was a language which had performance as an...
Edit: I am back to using neovim. I was a fanatic Vim user for about two years and use to believe that Vim is the only text editor that was cool. But, now I use Emacs. My emacs and neovim config What is the problem with Vim? # Well, Vim was a great tool for editing text, not for editing code. The one main issue I was facing with Vim was due to its...
Fist of all, a small apology. The tmux solution is a bit specific and works only if you are using macOS and iTerm as your terminal emulator. Get Vim to play nice # Getting Vim working with the system clipboard is the easy part. On macOS ( Sierra ) # This is very easy. You will have clipboard support out of the box. You can get the clipboard...