classpath config for gradle within vscode redhat java extension
Configuring the classpath for a Gradle project in Visual Studio Code (VSCode) involves specifying the dependencies and build settings.
Here’s a guide for both IDEs:
Search java source
Searching source configs inside .classpath and *.prefs files
Search java source config by substring path="src/main/java"
Replace output attribute to gradle build folder output="build/classes/java/main"
result looks like:
<classpathentry excluding="**/*.txt" output="build/clas ...
__dirname is not defined in ES module scope
explanation
Using typescript hybrid compiler to compile for ESM and CommonJS is a experimental for NodeJS.
Some function/magic function/constructor is not supported by CommonJS. So, you must define them manually, such as: __dirname, __filename
for an example below error outputs:
(node:11396) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11396) ExperimentalWarning: The N ...
How to overwrite cache in github actions workflow
Introduction
Introduction
In software development, caching is a commonly used technique to store frequently accessed data in a temporary storage location. This helps to improve performance and reduce the load on the server. Github Actions allows developers to incorporate caching in their workflows to speed up the build process. However, there may be situations where the cached data needs to be refreshed or overwritten. In this article, we will discuss how to overwrite cache in Github Actions ...
Install PHP for Android CLI or Web Server
Install PHP for Android
Introduction
Brief explanation of PHP programming language
Increasing popularity of using PHP in mobile app development
Purpose of the article
Overview of PHP programming in Android
History of PHP in Android
Advantages of using PHP in Android
Challenges faced in integrating PHP with Android
Getting Started with PHP in Android
Installing the necessary tools and software
Setting up a development environment
Creating a basic PHP app in Android
Utilizing PHP Features ...
custom passwordEncoder for spring boot java
Spring Boot Custom Password Encoder
Introduction
Brief explanation about the purpose of the article
Mention that the article will focus on how to implement a custom password encoder in Spring Boot
Understanding Password Encoding
Define password encoding
Explain the importance of password encoding in web applications
Mention common password encoding techniques (e.g. MD5, SHA-256)
Default Password Encoder in Spring Boot
Briefly explain the default password encoder used in Spring Boot
Menti ...
NPM Package Agent For Programmer In China
.yarnrc
disable-self-update-check true
registry "https://registry.npm.taobao.org"
phantomjs_cdnurl "https://npm.taobao.org/dist/phantomjs/"
electron_mirror "https://npm.taobao.org/mirrors/electron/"
electron_builder_binaries_mirror "https://npm.taobao.org/mirrors/electron-builder-binaries/"
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
chromedriv ...
git detach subfolder to their own repository
If you create a new clone of a repository, you can split the folder into another repository without losing your Git history or changes.
Open Git Bash.
Change your current working directory to where you want to create the new repository. 3. Clone the repository including subfolders.
$ git clone https://github.com/USERNAME/REPOSITORY-NAME
Change your current working directory to the cloned repository.
$ cd REPOSITORY-NAME
Five. To filter subfolders from the rest of the files in the reposit ...
Deprecated WebSecurityConfigurerAdapter Solution
How to solve Deprecated WebSecurityConfigurerAdapter in spring boot security >= 5.7.0-M2
SecurityConfiguration method structures
Spring Security v5.7.0-M2 deprecates WebSecurityConfigurerAdapter for customizing HTTP security.
Developers are strongly encouraged to prioritize content-based security configuration over extension classes.
This change focuses on adapting to newer practices.
Old codes
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerA ...
Spring Boot login programmatically
Important:
First you need a custom password encoder for your spring boot project, so you can log in using your user credentials. READ HERE - custom password encoder for spring boot.
Setup Spring Security
Expose context of org.springframework.security.authentication.AuthenticationManager from security config class to be used in LoginController
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org ...
how to setup local site domain vhost xampp windows 2024
How to setup vhost config on xampp for local site domain, support for multiple local site.
Setup hosts
127.0.0.1 localhost
127.0.0.1 mysite-dev.com
127.0.0.1 anothersite-dev.com
Setup httpd-vhost.conf
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerName mysite-dev.com # domain name
DocumentRoot "D:/Workspaces/PHP/ISP"
<Directory "D:/Workspaces/PHP/ISP">
Opti ...