Skip to content

Instantly share code, notes, and snippets.

View fridolin-koch's full-sized avatar
🔥

Frido Koch fridolin-koch

🔥
View GitHub Profile
package sheet12.simpledownloadclient;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class DownloadThread extends Thread {
public void error(final String errorMsg) {
SwingUtilities.invokeLater(new Runnable()
{
public void run() {
JOptionPane.showMessageDialog(
DownloadFrameThreaded.this, errorMsg, "Error", JOptionPane.ERROR_MESSAGE
);
}
});
<!-- Alt -->
<body class="font-family-ubuntu font-size-is-default menu-type-fusionmenu col12">
<!-- Neu -->
<body class="font-family-ubuntu font-size-is-default menu-type-fusionmenu col12 agn-body-sitebranding">
@fridolin-koch
fridolin-koch / gist:4135817
Created November 23, 2012 14:15
Random password and salt
$salt = '';
$password = '';
for($i=0;$i < 64;$i++) {
$char = '';
switch(rand(0,3)) {
//A-Z
case 0:
$char = chr(rand(65,90));
break;
//a-z