Skip to content

Instantly share code, notes, and snippets.

@srikarn
srikarn / spring-boot-angular.txt
Last active October 28, 2023 08:55
Spring boot configuration to forward to index page on 404
@Bean
ErrorViewResolver redirectToFrontEndOn404() {
return ( request, status, model ) -> status == HttpStatus.NOT_FOUND
? new ModelAndView("forward:/index.html", Collections.<String, Object>emptyMap(), HttpStatus.OK)
: null;
}
This is necessary on page refresh to avoid showing 404 or error pages
This forward also maintains the client route path, so angular will route to the correct route on reload.
@srikarn
srikarn / Problems Solutions
Created October 30, 2017 17:10
Problems faced during software development and solutions to them
Problem: Object not found error with jdbc even though the object exists
Solution: Check to see if the correct datasource is being used, it can be an issue with frameworks like spring-boot, which provide hsql datasource
@srikarn
srikarn / gist:450b733fa13dbb6fd42fcce1786dc11a
Created October 12, 2017 17:50
Awesome Resources I found useful
For the best explanation of git use the following url http://gitolite.com/gcs.html#(1)
@srikarn
srikarn / gist:e7c3bcd72c2f5f054dc34adb9fafcb17
Created May 19, 2017 15:47
Import an SVN Project in to git
* Clone the SVN Repo that you would like to convert to git
* SVN commit only has username associated with it, whereas Git commit is more richer, it contains user names and email addresses
* You can associate all the commits in git history with this info using an authors file
* Create the authors file as follows
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
* Install the svn2git as $ sudo gem install svn2git
* svn2git https://svn-idis.ea.vanderbilt.edu/idev/amcom --authors authors-transform.txt --username <username>
* that will convert your svn project to git, if there any error's regarding gc
* Since that is the last command ran by the utility, you can run git gc manually
* Create your remote repository and add it to your local