Skip to content

Instantly share code, notes, and snippets.

Paul N. Baker paul-nelson-baker

View GitHub Profile
View git-set-main.sh
#!/usr/bin/env bash
# Global configuration for new repos
git config --global init.defaultBranch main
# To update existing repos
git branch -m master main
git push origin :master main
git branch --set-upstream-to=origin/main main
@paul-nelson-baker
paul-nelson-baker / SpringMVC X-UA-Compatible Header.java
Last active Aug 29, 2015
Spring MVC response header for X-UA-Compatible: IE=edge,chrome=1
View SpringMVC X-UA-Compatible Header.java
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(@RequestHeader("User-Agent") String userAgent, HttpServletResponse response) {
logger.info(userAgent);
if (userAgent.contains("MSIE")) {
logger.info("Adding response header for IE");
response.addHeader("X-UA-Compatible", "IE=edge,chrome=1");
}
return "home";
}
You can’t perform that action at this time.