Skip to content

Instantly share code, notes, and snippets.

@hereswhatidid
hereswhatidid / HTMLElements.html
Created April 5, 2012 14:32
Styleguide of HTML Elements
<!-- Sample Content to Plugin to Template -->
<h1>CSS Basic Elements</h1>
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr />
<h1 id="headings">Headings</h1>
<h1>Heading 1</h1>
@hereswhatidid
hereswhatidid / jquery.placeholder.js
Created June 14, 2012 17:50
Check for and enable HTML5 placeholder attribute
$.support.placeholder = ('placeholder' in document.createElement('input'));
if (!$.support.placeholder) {
$('input[placeholder],email[placeholder]').each(function() {
$(this)
.val($(this).attr('placeholder'))
.on({
'focus': function() {
if ($(this).val() == $(this).attr('placeholder')) $(this).val('');
},
'blur': function() {
@hereswhatidid
hereswhatidid / jquery.rotator.js
Created June 22, 2012 19:10
Generic jQuery Rotator
(function( $ ){
$.fn.rotateit = function( options ) {
//
// Plugin settings with defaults set
//
// -----------------------------------------------------
var settings = $.extend( {
'shownav' : true,
'backnext' : false,
@hereswhatidid
hereswhatidid / clickbodytohide.js
Created July 26, 2012 18:05
Model click to remove scripts
$('html').click(function() {
//Hide the menus if visible
});
$('#menucontainer').click(function(event){
event.stopPropagation();
});
@hereswhatidid
hereswhatidid / Container.ascx
Created August 7, 2012 15:51
Add class to outer div in DotNetNuke containers
<%@ Control language="c#" AutoEventWireup="true" Explicit="True" Inherits="DotNetNuke.UI.Containers.Container" %>
<%@ Register TagPrefix="dnn" TagName="TITLE" Src="~/Admin/Containers/Title.ascx" %>
<script runat="server">
protected void Page_PreRender(object sender, EventArgs e) {
try {
HtmlGenericControl cParent = (HtmlGenericControl) this.Parent;
cParent.Attributes["class"] += " tab";
} catch (Exception ex) {
// do nothing
}
@hereswhatidid
hereswhatidid / tabs.js
Created August 7, 2012 15:52
Create Tabs from divs
//
// Tabbed containers
//
// -----------------------------------------------------
if ($('.tab').length > 1) {
var tabnav = $('<div class="tabs-nav"><ul /></div>'),
tabs = $('<div class="tabs" />'),
tabobject = $('<div class="tabbed-content span9" />'),
activefound = false,
tabwidth = 100 / $('.tab').length;
@hereswhatidid
hereswhatidid / web.config
Created September 18, 2012 15:50
IIS config file for setting cache header expiration
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="14.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
@hereswhatidid
hereswhatidid / web.config
Created November 16, 2012 15:41
IIS config file for setting a Vary: Accept-Encoding header
<?xml version="1.0" encoding="UTF-8"?>
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="Vary"></remove>
<add name="Vary" value="Accept-Encoding"></add>
</customHeaders>
</httpProtocol>
</system.webServer>
@hereswhatidid
hereswhatidid / nav.walker.blank.php
Created December 7, 2012 20:47
WordPress blank navigation walker
<?php
//
// Blank navigation list Walker
//
// -----------------------------------------------------
class Blank_Walker extends Walker_Nav_Menu
{
/**
* Start the element output.
*
@hereswhatidid
hereswhatidid / wp-config.php
Last active December 16, 2015 14:19
Useful wp-config.php options for WordPress
<?php
// Disable reinstalling Akismet and Hello, Dolly! plugins
// when upgrading WordPress core
define( 'CORE_UPGRADE_SKIP_NEW_BUNDLED', true);
// Disable built-in file editor
define('DISALLOW_FILE_EDIT', TRUE)