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 / meta_refresh.html
Created June 4, 2014 09:48
meta refresh: The redirects to the provided URL in 5 seconds. Set to 0 for an immediate redirect. - From http://snippetlib.com/html/meta_refresh
<meta http-equiv="refresh" content="5;url=http://example.com/" />
@voku
voku / multiple_file_input.html
Created June 4, 2014 09:49
multiple file input: File inputs can have an attribute of "multiple" which then allows multiple files to be selected in the file section dialog box. Firefox 3.6+ and WebKit browsers only are supporting it so far. Unfortunately the "multiple files" need to be within the same folder, as there is no interface for selecting one, moving folders, and …
<form method="post" action="upload.php" enctype="multipart/form-data">
<input name='uploads[]' type="file" multiple>
<input type="submit" value="Send">
</form>
@voku
voku / post_to_iframe.html
Created June 4, 2014 09:52
post data to an iframe: Doesn't take any JavaScript or anything. You just have the form's target attribute match the iframe's name attribute. The outer page doesn't even reload. But it might appear to at first glance since many browsers run the page-loading spinner in the tab when an iframe reloads. - From http://snippetlib.com/html/post_data_to…
<form action="iframe.php" target="my-iframe" method="post">
<label for="text">Some text:</label>
<input type="text" name="text" id="text">
<input type="submit" value="post">
</form>
<iframe name="my-iframe" src="iframe.php"></iframe>
.shadow {
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.8);
}
/* 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 }
@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.
*/
/* 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 */
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.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+ */
}
@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"/>