Skip to content

Instantly share code, notes, and snippets.

View Badbird5907's full-sized avatar

Evan Badbird5907

View GitHub Profile
@Badbird5907
Badbird5907 / .gitignore
Created September 11, 2021 23:15
gitignore template
# User-specific stuff
.idea/
*.iml
*.ipr
*.iws
# IntelliJ
out/
@Badbird5907
Badbird5907 / BoilerPlate.java
Created June 16, 2021 18:37
Boilerplate code to start a swing GUI
public BoilerPlate(){
JFrame frame = new JFrame();
JPanel panel = new JPanel();
frame.add(panel, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("title");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException | InstantiationException e) {
e.printStackTrace();
@Badbird5907
Badbird5907 / VelocityTemplateBuilder.java
Last active June 11, 2021 21:21
A builder I made for apache's velocity template
import lombok.Getter;
import lombok.Setter;
import spark.ModelAndView;
import spark.template.velocity.VelocityTemplateEngine;
import java.util.HashMap;
@Getter
@Setter
public class VelocityTemplateBuilder {
@Badbird5907
Badbird5907 / Unicode.java
Last active April 28, 2021 02:50
regex pattern to check if a string has unicode
public class Unicode{
public static boolean containsUnicode(String s){
//you're welcome i did it for you :D
Pattern p = Pattern.compile("[^a-z0-9~!@#$%^&*()_+-={}\\[\\]|:\";'<>?,./\\\\ ]", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(s);
return m.find();
}
}