UP | HOME

Random Notes

1 Intro

This entry has random notes that I consider useful for my emacs experience. Hope this will be useful for you too.

2 Honw to debug a nodejs program?

This is the helpful comment on GitHub thread. Look at the video I uploaded on YouTube.

3 Literate programming in org mode

3.1 What is literate programming?

It's basically the way we explain/describe and show the source of a program and (optionally) its result on a document. For details check out this wikipedia entry.

3.2 Show me

To do literate programming in emacs, we use org-mode in conjunction with org-babel.

1: #include<stdio.h>
2: 
3: int main(int argc, char *argv[])
4: {
5:   printf("%s\n", "Hello World");
6:   printf("Another Hello world");
7:   return 0;
8: }
Hello World
Another Hello world

3.3 lsp within code blocks

If you want to know what about the top line. Look at this references

const fun = (a, b) => {
    return a + b
}

const a = 7, b = 3;
console.log(fun(a, b))

3.4 Grep in emacs

We can grep in emacs, grep is a tool for looking for some text or regex inside a file or directory. Sometime when we are searching for some string that has a character like { } [ ] $, etc. To do that we need to escape them with a $ as prefix.

So for example if I want to search to some string that contains the following text {SOME_VARIABLE}, I can't just write it like that, emacs will not recognize that special character, so we need to escape it with a cash symbol $.