Posts

AST (Abstract Syntax Tree)

ts-morph: A Full Guide to Available Nodes and How to Use Them ts-morph is a TypeScript library that wraps the raw TypeScript Compiler API in friendlier, chainable classes. Instead of manually walking ts.Node objects and calling low-level compiler functions, you work with typed wrapper classes — ClassDeclaration , FunctionDeclaration , CallExpression , and roughly 220+ others — each exposing methods for reading, navigating, and rewriting that piece of source. Every wrapper ultimately extends a base Node class, so understanding that base class first makes everything else click into place. 1. The Node base class Every specific node type ( ClassDeclaration , Identifier , IfStatement , etc.) inherits from Node . This gives all of them a shared set of capabilities: Identity & text getKind() — returns the SyntaxKind enum value (e.g. SyntaxKind.ClassDeclaration ). getKindName() — the human-readable string version of the kind. getText() — the...

Configure self signed certificate on a locally hosted website

 1. create a private key cd /etc/ssl/aureusapps sudo openssl genrsa -des3 -out aureusapps.key 2048 create with a password 2. Create a self signed certificate to use as root CA sudo openssl req -x509 -new -key aureusapps.key -sha256 -days 1825 -out aureusapps.pem Country: LK State or Province: Western Locality: Colombo Organization Name: AureusApps Common Name: *.aureusapps.dev Email: admin@aureusapps.dev -x509: Specifies that the certificate is to be self-signed rather than signed by a Certificate Authority (CA). This option is used for generating a root or self-signed certificate. -new : generate new certificate request -noenc : if a private key is created it will not be encrypted -key : provides the private key for signing a new certificate or certificate request -sha256 : Specifies SHA-256 as the hashing algorithm 3. Install root certificate  sudo trust anchor aureusapps.pem 4. Creating CA-Signed Certificates for Your Dev Sites     1. Create private...

Optimize Gnome Desktop Environment

 1. Remove Gnome software - Gnome software has a memory leak issue. sudo pacman -Rscn gnome-software 2. Disable indexing services (If you don't use it) systemctl --user mask tracker-extract-3.service tracker-miner-fs-3.service tracker-miner-rss-3.service tracker-writeback-3.service tracker-xdg-portal-3.service tracker-miner-fs-control-3.service 3. disable evolution services (Personal information management such as email. calendar and address book) systemctl --user mask evolution-user-prompter.service systemctl --user mask evolution-source-registry.service systemctl --user mask evolution-calendar-factory.service systemctl --user mask evolution-addressbook-factory.service 4. Remove gnome online accounts sudo rm /usr/share/applications/gnome-online-accounts-panel.desktop 5. Remove gsd wacom sudo rm /usr/share/applications/gnome-wacom-panel.desktop get it back by installing gnome control center

Android: Set AutoCompleteTextView popup background corner radius

 This is a most cumbersome problem. If MaterialAutoCompleteTextView, or  AutoCompleteTextView  is used, it is hard to style it with theme attributes, because corner radius is hard coded https://github.com/material-components/material-components-android/blob/784f901135c654e938a4b0a71252b6887a276244/lib/java/com/google/android/material/textfield/DropdownMenuEndIconDelegate.java#L212 . It seems the only solution that is working is setting it manually. According to material specs, the corner radius of AutoCompleteTextView popup should be set to 4dp.   https://material.io/components/menus#exposed-dropdown-menu

Maven - Create Executable Jar

Image
In this article we focus on how executable jar file is created in maven project. Usually we want to create java package and run it without specifying classpath of the main class that we want to execute. For this purpose we want to specify application entry point in the Jar manifest as follows. Manifest-Version: 1.0 Created-By: 1.7.0_06 (Oracle Corporation) Main-Class: MyPackage.MyClass So that we can execute our jar file in the terminal as follows. java -jar MyJar.jar Configuration We have to configure our pom.xml file and set packaging property as jar. <groupId>com.udara</groupId> <artifactId>tcp-client</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> In maven we can configure jar manifest using plugins. Here we talk about few p...

Apache Tomcat - Brief Introduction

Image
What is Apache Tomcat? Apache Tomcat is an open source web sever and servlet container developed by apache software foundation. It implements Java servlet and Java Server Pages (JSP) specificartions from sun microsystems. What is Servlet? Servlet is is an app that runs on a server. Installing (1) Download and Install a Java SE Runtime Environment (JRE) (1.1) Download a Java SE Runtime Environment (JRE), release version 8 or later, from http://www.oracle.com/technetwork/java/javase/downloads/index.html (1.2) Install the JRE according to the instructions included with the release. You may also use a full Java Development Kit (JDK) rather than just a JRE. (2) Download and Install Apache Tomc...

Popular posts from this blog

JAudioTagger - ID3 tagger library

Flutter - Create Image Container with Round Corners and Splash Effect

Maven - Create Executable Jar