Skip to content

Instantly share code, notes, and snippets.

@Webklex
Webklex / zip_folder.sh
Created August 12, 2014 07:19
Zip a folder in Linux
#To zip a folder
zip -9 -r <zip file> <folder name>
#To zip a single file:
zip -9 <zip file> <filename>
#Use "-9" for best compression. The compressed file works fine with Windows XP compression tool.
@Webklex
Webklex / add_font_ubuntu.sh
Created June 12, 2014 08:15
Add fonts - UBUNTU/XUBUNT
cd /usr/share/fonts/truetype
sudo thunar
#Ordner erstelln und öffnen
#Entsprechende Datein kopieren
sudo fc-cache -f
@Webklex
Webklex / all_known_currencys.php
Created June 4, 2014 07:45
An array filled with all known currencys
array(
'AED' => array(
'display_name' => 'UAE Dirham',
'numeric_code' => 784,
'default_fraction_digits' => 2,
'sub_unit' => 100,
),
'AFN' => array(
'display_name' => 'Afghani',
'numeric_code' => 971,
@Webklex
Webklex / RadioCheckboxes_HACK.css
Created April 11, 2014 14:58
Radio/Checkboxes HACK
/*******************************************************************************
* Radio/Checkboxes HACK
*******************************************************************************/
input[type=checkbox]:not(old),
input[type=radio ]:not(old){
width : 2em;
margin : 0;
padding : 0;
font-size : 1em;
opacity : 0;
@Webklex
Webklex / php_speedtest.php
Created March 20, 2014 08:25
Speedtest für PHP Scripte - bzw Server
<?php
/*
##########################################################################
# PHP Benchmark Performance Script #
# © 2010 Code24 BV #
# #
# Author : Alessandro Torrisi #
# Company : Code24 BV, The Netherlands #
# Date : July 31, 2010 #
# version : 1.0 #
@Webklex
Webklex / mehrwertsteuer_berechnen.php
Created March 17, 2014 15:40
Mehrwertsteuer mit PHP berechnen
<?php
$netto = 1.50;
$mwsatz = 1.19; //19%
$brutto = $netto * $mwsatz;
$mwst = $brutto - $netto;
echo 'OUTPUT:'."\n";
@Webklex
Webklex / iban_berechnen.php
Created February 6, 2014 07:25
IBAN berechnen mittels PHP
$laenderkennung_translate = false;
$laenderkennung = $_POST['land'];
$bankleitzahl = $_POST['bankleitzahl'];
$kontonummer = $_POST['kontonummer'];
while(strlen($kontonummer) < 10){
$kontonummer = '0'.$kontonummer;
}
$alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
@Webklex
Webklex / localize_php_ini.txt
Created October 23, 2013 09:37
php.ini lokalisieren
/etc/php5/apache2/php.ini
@Webklex
Webklex / graceful_apache2_restart.sh
Created October 23, 2013 09:36
Restart Apache Server Graceful
#Schritt 1
apache2ctl configtest
#Schritt 2 wenn Schritt 1 = OK
/etc/init.d/apache2 graceful
@Webklex
Webklex / file_handling.php
Created October 18, 2013 08:39
Write to File - File handling
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Bobby Bopper\n";
fwrite($fh, $stringData);
$stringData = "Tracy Tanner\n";
fwrite($fh, $stringData);
fclose($fh);
#SRC: http://www.tizag.com/phpT/filewrite.php