Skip to content

Instantly share code, notes, and snippets.

@patocallaghan
patocallaghan / AddJSClass.js
Created March 8, 2012 11:17
Replacing "no-js" class on HTML tag with "js" (similar to how Modernizr does it)
(function(doc, classToAdd){
doc.className = (doc.className).replace("no-js", classToAdd);
})(document.documentElement, "js");
@patocallaghan
patocallaghan / FirefoxOnlyCSS.css
Created May 15, 2012 23:33
CSS to target only Mozilla browsers #css #firefox
@-moz-document url-prefix() {
h1 {
color: red;
}
}
@patocallaghan
patocallaghan / webkit-css.css
Created May 15, 2012 23:37
CSS to target only Webkit browsers #css #webkit #chrome #safari
@media screen and (-webkit-min-device-pixel-ratio:0) {
/* put webkit CSS here*/
}
@patocallaghan
patocallaghan / ie8legendbugfix.css
Created May 28, 2012 01:27
IE8 Legend display:none bugfix #css #ie8 #legend
/* From http://snipplr.com/view/22523/ */
legend {
display: block !important;
height: 0;
margin: 0;
padding: 0;
width: 0;
visibility: hidden;
}
c:\Dev>mkdir test
c:\Dev>cd test
c:\Dev\test>node --version
v0.6.18
c:\Dev\test>npm --version
1.1.21
@patocallaghan
patocallaghan / docpad6.0.0.txt
Created June 20, 2012 11:25
DocPad Error v6.0.7
c:\Dev>mkdir docpad
c:\Dev>cd docpad
c:\Dev\docpad>docpad --version
6.0.7
c:\Dev\docpad>docpad run -d
debug: DocPad loaded succesfully
→ [2012-06-20 23:12:57.446] [C:\Users\Pat\AppData\Roaming\npm\node_modules\docpad\out\lib\docpad.js] [DocPad.log]
@patocallaghan
patocallaghan / checkbox-align.css
Created June 20, 2012 11:32
Handy checkbox alignment #css #forms #checkbox
/* Source: http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers */
/*=====
<form>
<div>
<label><input type="checkbox" /> Label text</label>
</div>
</form>
=======*/
<style type="text/css">
@patocallaghan
patocallaghan / css-triangle.scss
Created June 21, 2012 01:07
CSS Triangles SCSS Mixin #css #scss #triangle #mixin
//==== Simple SCSS mixin to create CSS triangles
//==== Example: @include css-triangle ("up", 10px, #fff);
@mixin css-triangle ($direction: "down", $size: 20px, $color: #000) {
width: 0;
height: 0;
border-left: $size solid #{setTriangleColor($direction, "left", $color)};
border-right: $size solid #{setTriangleColor($direction, "right", $color)};
border-bottom: $size solid #{setTriangleColor($direction, "bottom", $color)};
border-top: $size solid #{setTriangleColor($direction, "top", $color)};
}
@patocallaghan
patocallaghan / placeholder.css
Created August 14, 2012 04:27
Style form input/textarea placeholder text #css #placeholder #textarea #input
/* From http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css */
::-webkit-input-placeholder {
color: #999;
}
:-moz-placeholder {
color: #999;
}
@patocallaghan
patocallaghan / repeat.aspx
Created August 22, 2012 23:03
.Net Repeater functionality #csharp #repeater
////Adding this so I don't forget
/*
In code-behind
var list = GetList();
repeaterId.DataSource = list;
repeaterId.DataBind();
*/
<asp:repeater runat="server" id="spiceimages">
<HeaderTemplate>