Skip to content

Instantly share code, notes, and snippets.

View fridolin-koch's full-sized avatar
🔥

Frido Koch fridolin-koch

🔥
View GitHub Profile
@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
<!-- 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">
public void error(final String errorMsg) {
SwingUtilities.invokeLater(new Runnable()
{
public void run() {
JOptionPane.showMessageDialog(
DownloadFrameThreaded.this, errorMsg, "Error", JOptionPane.ERROR_MESSAGE
);
}
});
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 {
/*
* Author: Frido Koch
* Email: [email protected]
* License: CC BY-NC-SA 3.0 DE
* http://creativecommons.org/licenses/by-nc-sa/3.0/de/
*/
package sheet10;
import static org.junit.Assert.*;
<?php
//old
$this->breadcrumbs[] = array(
'name' => $translator->trans('Home'),
'path' => $this->generateUrl('_index', array()),
);
//new
$this->breadcrumbs[] = [
'name' => $translator->trans('Home'),
'path' => $this->generateUrl('_index', []),
<tr>
<td>Umsatzsteuer (67)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19,00&nbsp;&nbsp;&nbsp;%&nbsp;&nbsp;&nbsp;aus&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ advice.sumNetValue|number_format(2, ',', '.') }}</td>
<td style="text-align: right">{{ advice.sumSalesTax|number_format(2, ',', '.') }}</td>
</tr>
@fridolin-koch
fridolin-koch / app.php
Created October 22, 2013 13:35
PHP AWS SDK - S3 StreamWrapper with ACL and ContentType
<?php
//autoloader
require_once __DIR__ . '/vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\S3\Enum\CannedAcl;
//init client
$s3Client = S3Client::factory(array(
'key' => '<key>',
'secret' => '<secret>',
@fridolin-koch
fridolin-koch / convert-table.php
Last active December 26, 2015 10:09
CSV to Redmine table
#!/usr/bin/env php
<?php
if ($argc < 2) {
printf('Usage: %s <filename>' . PHP_EOL, $argv[0]);
exit(1);
}
if (!file_exists($argv[1])) {
printf('File %s was not found' . PHP_EOL, $argv[1]);
@fridolin-koch
fridolin-koch / 0_reuse_code.js
Created November 2, 2013 21:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console