Skip to content

Instantly share code, notes, and snippets.

public static function slugify($text)
{
$search = array('ö', 'ä', 'ü', 'ß');
$replace = array('oe', 'ae', 'ue', 'ss');
// replace german letters
$text = str_replace($search, $replace, strtolower($text));
// replace all non letters or digits by -
$text = preg_replace('/\W+/', '-', $text);
@bogomolov-dev
bogomolov-dev / formatFileSize
Created January 28, 2014 13:18
Rechnet die übergebenen Bytes in die nächste passende Einheit um.
function formatFileSize($bytes)
{
$units = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
$result = "0.00 B";
if($bytes > 0)
{
$result = log($bytes) / log(1024);
$index = floor($result);
$result = round(pow(1024, $result - ($index)), 2)." ".$units[$index];
@bogomolov-dev
bogomolov-dev / responsive-iframe.scss
Created February 21, 2014 13:21
Responsive embedded iframe
.wrapper {
position:relative;
padding-bottom:56.25%;
padding-top:30px;
height:0;
overflow:hidden;
iframe {
position:absolute;
top:0;
@bogomolov-dev
bogomolov-dev / frame-breakout.js
Created February 21, 2014 14:25
Frame breakout
if (top.location != self.location) {
top.location = self.location.href;
}
"require": {
[...],
"symfony/finder": "2.4.*"
}
// Vibriere 300ms, mach 200ms Pause und vibriere anschließend 800ms.
navigator.vibrate([300, 200, 800]);
:-webkit-full-screen,
:-moz-full-screen,
:-ms-fullscreen,
:fullscreen {
/* Eigenschaften */
}
::backdrop,
::-ms-backdrop {
/* Eigenschaften */
"require": {
[...]
"besimple/soap": "0.2.*"
}
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script>
// Unser Code
</script>
be_simple_soap:
cache:
type: none # The cache type can be: none, disk (default value), memory, disk_memory.
lifetime: 0 # The lifetime in seconds of a WSDL file in the cache (86400 is the default value by PHP).
limit: 5 # The limit is the maximum number of in-memory cached WSDL files (5 is the default value by PHP).
clients:
blz_service:
wsdl: http://www.thomas-bayer.com/axis2/services/BLZService?wsdl
classmap: