Skip to content

Instantly share code, notes, and snippets.

View basteez's full-sized avatar

Tiziano Basile basteez

View GitHub Profile

Easy Amiibo Emulation - https://bit.ly/2z0m09k

(^ that's a short-link to this page, so you can open it in Linux)

Some users are discussing this guide in #hacking on the JoyConDroid Discord: https://discord.gg/SQNEx9v.

DO NOT ask for, or share links to, Amiibo bins in the comments! They will be removed. Thank you for understanding.

(Windows|Linux PC) + JoyControl + Bluetooth = AMIIBO EMULATION

@basteez
basteez / iterateEnumeration.java
Last active November 25, 2018 14:34
JavaEE - Iterate through request parameters
PrintWriter writer = resp.getWriter();
Enumeration<String> paramNames = req.getParameterNames();
writer.append("<h2>Parameters</h2>");
writer.append("<h3>URL Parameters</h3>");
writer.append("<ul>");
while(paramNames.hasMoreElements()){
String param = paramNames.nextElement(); //do not use req.getParameterNames() here or it goes in an infinite loop
writer.append("<li>" + param + "</li>");
String values[] = req.getParameterValues(param);
writer.append("<ul>");
@basteez
basteez / getMd5Hash.java
Created September 11, 2018 16:56
JAVA - Create MD5 Hash
public static String getMd5Hash(String baseString) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(baseString.getBytes());
byte byteData[] = md.digest();
StringBuffer sb = new StringBuffer();
for(int i = 0; i < byteData.length; i++) {
sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
}
return sb.toString();
@basteez
basteez / deployment descriptor.xml
Created July 26, 2018 08:10
JavaEE - web.xml session complete configuration
<session-config>
<session-timeout>30</session-timeout>
<cookie-config>
<name>JSESSIONID</name>
<domain>example.org</domain>
<path>/shop</path>
<comment><![CDATA[Keeps you logged in. See our privacy policy for
more information.]]></comment>
<http-only>true</http-only>
<secure>false</secure>
@basteez
basteez / initLaF.java
Last active March 28, 2018 13:19
SWING - Set system look and feel
private static void initLaF()
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(UnsupportedLookAndFeelException e){e.printStackTrace();}
catch(ClassNotFoundException e){e.printStackTrace();}
catch(InstantiationException e){e.printStackTrace();}
catch(IllegalAccessException e){e.printStackTrace();}