Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
NapoleonWils0n / style.css
Created Oct 29, 2012
css: css3 stylesheet
View style.css
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}
View html5_figure_block.html
<figure class="block">
<img src="image.jpg" alt="image"/>
<legend class="">Image Caption
<small>Photo copyright text</small>
</legend>
</figure>
@NapoleonWils0n
NapoleonWils0n / gist:3983799
Created Oct 30, 2012
apache: rewrite no www
View gist:3983799
RewriteEngine On
RewriteCond %{HTTP_HOST} ^your-site.com [NC]
RewriteRule ^(.*)$ http://www.your-site.com/$1 [L,R=301]
@NapoleonWils0n
NapoleonWils0n / gist:3983801
Created Oct 30, 2012
apache: force files to download
View gist:3983801
<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 Oct 30, 2012
apache: match files force download
View gist:3983805
<FilesMatch "\.(?i:pdf|mov|mp4|m4v)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
View absolute_center_image.html
<html>
<body>
<table id="wrapper">
<tr>
<td><img src="logo.png" alt="" /></td>
</tr>
</table>
</body>
</html>
View apple_touch_icon.html
<link rel="apple-touch-icon" href="/apple_touch_icon.png" />
View favicon.html
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
View html5_article.html
<article>
<header class="article-header">
<h1 class="title">Title</h1>
</header>
<div class="content"></div>
<footer class="article-info meta"></footer>
</article>
@NapoleonWils0n
NapoleonWils0n / ie_comment.html
Created Oct 31, 2012
html: ie conditional comment
View ie_comment.html
<!--[if IE]><link rel="stylesheet" media="screen" type="text/css" href="ie.css" /><![endif]-->