Skip to content

Instantly share code, notes, and snippets.

View attacomsian's full-sized avatar
🌱
Fore Studio

Atta ✨ attacomsian

🌱
Fore Studio
View GitHub Profile
@attacomsian
attacomsian / QRAndLogo.java
Created January 21, 2021 06:39 — forked from wombat/QRAndLogo.java
QR-Code with embedded logo
// Create new configuration that specifies the error correction
Map<EncodeHintType, ErrorCorrectionLevel> hints = new HashMap<EncodeHintType, ErrorCorrectionLevel>();
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
QRCodeWriter writer = new QRCodeWriter();
BitMatrix bitMatrix = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
// Create a qr code with the url as content and a size of 250x250 px
public class AjaxAwareAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint {
public AjaxAwareAuthenticationEntryPoint(String loginFormUrl) {
super(loginFormUrl);
}
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
String ajaxHeader = ((HttpServletRequest) request).getHeader("X-Requested-With");
if ("XMLHttpRequest".equals(ajaxHeader)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "Ajax Request Denied (Session Expired)");
@attacomsian
attacomsian / Laravel.md
Created November 16, 2020 09:12 — forked from ffmit/Laravel.md
Laravel - Frequently used commands

Laravel - Standard tasks for a new project

Mac: Prerequisites

Mac: Node / Install or update

Mac: Update Node

Mac: n needs to be installed

npm install -g n