Skip to content

Instantly share code, notes, and snippets.

View themasch's full-sized avatar

Mark Schmale themasch

View GitHub Profile
@themasch
themasch / mkindex.sh
Last active December 17, 2015 13:10 — forked from tobybaier/mkindex.sh
Tweaked tobybaiers version of his mkindex.sh file a little bit. There might me room for more improvments but i'm by far not a sh wizard. (Add <ul>
#!/bin/sh
for i in $1/*.mp3;
do
file=$(basename $i)
echo "<li><audio preload='none' controls='controls'><source src='$file' type='audio/mp3'/></audio> <a href='$file'>download $file</a></li>" >> "$1/index.html";
done;
echo "<li><a href='$1'>$1</a></li>" >> index.html
<?php
class db {
// Eigenschaft um die Datenbankverbindung zu speichern.
protected static $con = null;
// Zugangsdaten als Parameter weil global böse ist
public static function createConnection($host, $name, $user, $pass) {
// neue Verbindung erzeugen und in Klasse speichern.
self::$con = new mysqli($host, $user, $pass, $name);