Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
NapoleonWils0n / style.css
Created October 29, 2012 20:37
css: css3 stylesheet
html {margin: 0; padding: 0;}
body {margin: 0; padding: 0;
background: rgb(102,102,102); color: rgb(235,235,235);
font: 12px/1.5 Helvetica, sans-serif;
}
article {display: block; margin: 0; padding: 0;}
aside {display: block; margin: 0; padding: 0;}
header {display: block; margin: 0; padding: 0;}
hgroup {display: block; margin: 0; padding: 0;}
figure {display: block; margin: 0; padding: 0}
@NapoleonWils0n
NapoleonWils0n / gist:3983799
Created October 30, 2012 23:31
apache: rewrite no www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^your-site.com [NC]
RewriteRule ^(.*)$ http://www.your-site.com/$1 [L,R=301]
@NapoleonWils0n
NapoleonWils0n / gist:3983801
Created October 30, 2012 23:32
apache: force files to download
<IfModule mime_module>
AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .mp4
AddType application/octet-stream .m4v
AddType application/octet-stream .mp3
@NapoleonWils0n
NapoleonWils0n / gist:3983805
Created October 30, 2012 23:33
apache: match files force download
<FilesMatch "\.(?i:pdf|mov|mp4|m4v)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
@NapoleonWils0n
NapoleonWils0n / absolute_center_image.html
Created October 31, 2012 00:28
html: absolute center image
<html>
<body>
<table id="wrapper">
<tr>
<td><img src="logo.png" alt="" /></td>
</tr>
</table>
</body>
</html>
@NapoleonWils0n
NapoleonWils0n / apple_touch_icon.html
Created October 31, 2012 00:28
html: apple-touch-icon
<link rel="apple-touch-icon" href="/apple_touch_icon.png" />
@NapoleonWils0n
NapoleonWils0n / favicon.html
Created October 31, 2012 00:35
html: favicon
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
@NapoleonWils0n
NapoleonWils0n / html5 video media queries.html
Created October 31, 2012 00:44
html: html5 video media queries
<video controls preload="none" poster="/images/video.png">
<source src="mobile.mp4" type="" media="screen and (max-device-width:320px)">
<source src="desktop.mp4" type="" media="screen and (min-device-width:321px)">
</video>
@NapoleonWils0n
NapoleonWils0n / html5_article.html
Created October 31, 2012 00:48
html: html5 article
<article>
<header class="article-header">
<h1 class="title">Title</h1>
</header>
<div class="content"></div>
<footer class="article-info meta"></footer>
</article>
@NapoleonWils0n
NapoleonWils0n / html5_figure_block.html
Created October 31, 2012 00:48
html: html5 figure block
<figure class="block">
<img src="image.jpg" alt="image"/>
<legend class="">Image Caption
<small>Photo copyright text</small>
</legend>
</figure>