Skip to content

Instantly share code, notes, and snippets.

View voku's full-sized avatar
:octocat:
There is nothing good unless you do it.

Lars Moelleken voku

:octocat:
There is nothing good unless you do it.
View GitHub Profile
@voku
voku / imageResize.php
Last active August 29, 2015 14:02
image-resize via ImageWorkshop (PHP) - Link: http://phpimageworkshop.com/
<?php
/**
* Get the name without extension
*
* @param String $filename
*
* @return String | false (by error)
*/
function getFileName($filename)
@voku
voku / json.php
Created June 4, 2014 10:35
create and parse JSON-DATA via PHP - DEMO: http://ideone.com/bz6gjc
<?php
// create JSON data format
$json_data = array ('id'=>1,'name'=>"rolf",'country'=>'russia',"office"=>array("google","oracle"));
echo json_encode($json_data);
echo "\n\n";
// parse JSON data into PHP object
$json_string='{"id":1,"name":"rolf","country":"russia","office":["google","oracle"]} ';
@voku
voku / not_selectable.css
Created June 4, 2014 10:28
make text not selectable: Make text not selectable by user. - From http://snippetlib.com/css/make_text_not_selectable - DEMO: http://jsfiddle.net/voku/79swC/
.notSelect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@voku
voku / no_cache_for_css.php
Created June 4, 2014 10:25
make stylesheet not cache: Use this script to make the stylesheet load every time and not cache. - From http://snippetlib.com/css/make_stylesheet_not_cache
<link href="css/stylesheet.css?t=<?php echo time(); ?>" rel="stylesheet" type="text/css"/>
/* Browser specific (not valid) styles to make preformatted text wrap */
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css">
/* Times New Roman-based stack */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* Modern Georgia-based serif stack */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
/* Traditional Garamond-based serif stack */
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
/* Helvetica/Arial-based sans serif stack */
@voku
voku / clearfix.css
Created June 4, 2014 10:02 — forked from anselmh/clearfix.css
clear floats without structural markup: ".clearfix" is the container that holds all of your floated elements. Works in all browsers that support "float" and "clear". - DEMO: http://jsfiddle.net/voku/ZQXgL/
/*
* Clearfix for modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* `contenteditable` attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
/* Selector Hacks */
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
html>body #tres { color: red }
.shadow {
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.8);
}