Skip to content

Instantly share code, notes, and snippets.

<Files *.pdf>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>
foreach ( $_POST as $key=>$value ) {
$$key = $value; }
<!-- Open Graph Meta Tags -->
<meta property="og:image" content="">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="">
<meta property="og:title" content="">
<meta property="og:type" content="">
<meta property="og:url" content="">
<!-- Facebook Meta Tags -->
<meta property="fb:app_id" content="[FB_APP_ID]" />
@seanwalsh
seanwalsh / Product
Created August 17, 2013 12:50
Working on a default product code base.
<section id="item" itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Product Name</h1>
<img class="item-image" itemprop="image" src="http://placehold.it/100x75&text=placeholder">
<div class="item-details">
<span class="item-brand" itemprop="brand">Brand Name</span>
</div><!-- /.item-details -->
<div class="item-offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
@seanwalsh
seanwalsh / Proper Usage of Label
Created August 18, 2013 19:29
Giving your label a 'for' attribute with the same value as the ID of the field will allow the user to click the label and the browser will focus on the form field. This is especially useful for radio and checkboxes.
<label for="nameFirst">First Name</label>
<input type="text" id="nameFirst">
@seanwalsh
seanwalsh / slideElementByID
Last active December 21, 2015 08:08
Toggle slide an element by ID. Set the custom data-attribute data-action-id to the ID that should be toggled.
function slideElementByID(event, element){
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
var elementID = $(element).attr("data-action-id");
if( $("#" + elementID).is(':visible') ) {
$("#" + elementID).slideUp();
} else {
background-image: url("@{base-url}/images/bg.png");
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="_assets/ico/apple-touch-icon-144.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="_assets/ico/apple-touch-icon-114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="_assets/ico/apple-touch-icon-72.png">
<link rel="apple-touch-icon-precomposed" href="_assets/ico/apple-touch-icon-57.png">
<link rel="shortcut icon" href="_assets/ico/favicon.png">
@seanwalsh
seanwalsh / web server 10.8
Created August 26, 2013 16:36
Setup web server on OS 10.8
Pref Pane: http://clickontyler.com/blog/2012/02/web-sharing-mountain-lion/
Source http://machiine.com/2013/how-to-install-apache-and-php-on-a-mac-with-osx-10-8-mamp-part-1/
sudo nano /etc/apache2/httpd.conf
sudo nano /etc/apache2/users/username.conf
<Directory "/Users/username/Sites" >
Options FollowSymLinks Indexes MultiViews
AllowOverride All
<?php
// SERVER NAME
$serverName = $_SERVER['SERVER_NAME'];
$productionServer = "";
// SET DATABASE LOCAL/PRODUCTION
if ( $serverName == "localhost") {
$mysqli_host = "127.0.0.1";
$mysqli_user = "root";