Skip to content

Instantly share code, notes, and snippets.

View mikedugan's full-sized avatar

Mike Dugan mikedugan

View GitHub Profile
@mikedugan
mikedugan / scss_reset.scss
Created November 7, 2013 14:26
CSS reset - designed for SASS
/*CSS Reset - Specifically for SASS /*
/*
Sass Reset
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4,
h5, h6, p, blockquote, pre, a, abbr, acronym, address, big,
cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small,
strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd,
ol, ul, li, fieldset, form, label, legend, table, caption,
@mikedugan
mikedugan / responsive_queries.css
Created November 7, 2013 14:27
responsive queries including specific targets for idevices
/*media queries for responsive design -- use what you need */
/* Smartphones (portrait and landscape) -----------
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
@mikedugan
mikedugan / sky_gradients.css
Created November 7, 2013 14:27
various sky color gradients
.sky-gradient-00, .sky-gradient-24 { background: #00000c; }
.sky-gradient-01 { background: linear-gradient(to bottom, #020111 85%,#191621 100%); }
.sky-gradient-02 { background: linear-gradient(to bottom, #020111 60%,#20202c 100%); }
.sky-gradient-03 { background: linear-gradient(to bottom, #020111 10%,#3a3a52 100%); }
.sky-gradient-04 { background: linear-gradient(to bottom, #20202c 0%,#515175 100%); }
.sky-gradient-05 { background: linear-gradient(to bottom, #40405c 0%,#6f71aa 80%,#8a76ab 100%); }
.sky-gradient-06 { background: linear-gradient(to bottom, #4a4969 0%,#7072ab 50%,#cd82a0 100%); }
.sky-gradient-07 { background: linear-gradient(to bottom, #757abf 0%,#8583be 60%,#eab0d1 100%); }
.sky-gradient-08 { background: linear-gradient(to bottom, #82addb 0%,#ebb2b1 100%); }
.sky-gradient-09 { background: linear-gradient(to bottom, #94c5f8 1%,#a6e6ff 70%,#b1b5ea 100%); }
@mikedugan
mikedugan / ie6_shadow.css
Created November 7, 2013 14:28
ie6 text shadow hack
/* text shadow with IE hack. replace values as needed */
.text {
text-shadow: 1px 1px 1px #666;
filter: Shadow(Color=#666666, Direction=135, Strength=5);
}
@mikedugan
mikedugan / bg_transparent.css
Created November 7, 2013 14:29
transparent background using an image
/*transparent background image
* make sure you change the url and opacity to suit */
.element {
position:relative;
z-index:1;
}
.element:before {
content:"";
@mikedugan
mikedugan / idevice.html
Created November 7, 2013 14:30
sms and call links for idevices
<!-- drop change the phone numbers and link text and drop this code wherever you want a smartphone call/text link -->
<a href="tel:1-408-555-5555">1-408-555-5555</a>
<a href="sms:1-408-555-1212">New SMS Message</a>
@mikedugan
mikedugan / addCommas.js
Created November 7, 2013 14:32
adds commas to a string of numbers for readability
function addCommas(nStr) {
nStr += '';x = nStr.split('.');x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}return x1 + x2;}
@mikedugan
mikedugan / audio.js
Created November 7, 2013 14:32
plays an audio element using HTML audio tags
function playAudio(audio){
document.getElementById(audio).play();
}
/*
---------Add the following to your HTML doc (somewhere above the JavaScript include) --------
<audio id="audio" src="audio.wma" preload="auto" controls></audio>
@mikedugan
mikedugan / collapse.js
Created November 7, 2013 14:33
collapses an item with the given class
function collapsePost() {
$('a.colPost').click(function(event) {
event.preventDefault();
$(this).toggleClass('collapsed');
if($(this).hasClass('collapsed')) {
$(this).text('Expand'); }
else {$(this).text('Collapse');}
var post = $(this).parent().parent().children('.content');
var author = post.siblings('.postInfo');
author.toggleClass('postcollapsed'); post.toggle();
@mikedugan
mikedugan / validate_email.jquery.js
Created November 7, 2013 14:34
validates an email address
function IsEmail(email) {
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regex.test(email);
}
//m_c1_txtReqEmail
var TempEmail = $('#m_c1_txtReqEmail').val();
if (IsEmail(TempEmail) == false) {