Skip to content

Instantly share code, notes, and snippets.

@steveosoule
steveosoule / line-breaks-ellipsis.css
Created November 1, 2012 21:45
Line Break Handling
.break {
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@steveosoule
steveosoule / hiding-text.css
Created November 1, 2012 21:45
Removing Text
.ir {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@steveosoule
steveosoule / print-friendly-css.css
Created November 1, 2012 21:46
Print Friendly Css
@media print {
* {
background: none !important;
color: black !important;
box-shadow: none !important;
text-shadow: none !important;
/* Images, vectors and such */
filter: Gray(); /* IE4-8: depreciated */
filter: url('desaturate.svg#grayscale'); /* SVG version for IE10, Firefox, Safari 5 and Opera */
@steveosoule
steveosoule / retina-display-media-query.css
Created November 1, 2012 21:46
Retina Display Media Query
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2), /* Looks like a bug, so may want to add: */
only screen and ( -moz-min-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
/* Your retina specific stuff here */
}
@steveosoule
steveosoule / highlight-depricated-elements.css
Created November 1, 2012 21:47
Highlight Depricated or Invalid Mark Up
/* Empty Elements */
.debug div:empty, .debug span:empty,.debug li:empty,.debug p:empty,.debug td:empty,.debug th:empty {
padding: 20px;
border: 5px dotted yellow !important;
}
/* Empty Attributes */
.debug *[alt=""], .debug *[title=""], .debug *[class=""], .debug *[id=""], .debug a[href=""] {
border: 5px solid yellow !important;
}
@steveosoule
steveosoule / .htaccess
Created November 7, 2012 20:18
Force Secure URL on a specific page
# Force secure mode access for Miva Merchant admin.mvc:
RewriteEngine On
RewriteCond %{REQUEST_URI} /mm5/admin.mvc
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.walleyedirect.com/mm5/admin.mvc [R]
@steveosoule
steveosoule / ie-html-tag-comment.html
Created November 8, 2012 17:43
IE HTML Tag Comments
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html> <!--<![endif]-->
@steveosoule
steveosoule / javascript-browser-info.js
Created November 14, 2012 18:12
JavaScript Browser Info
// JavaScript Document// Example:
// var b = new BrowserInfo();
// alert(b.version);
function BrowserInfo(){
this.name = navigator.appName;
this.codename = navigator.appCodeName;
this.version = navigator.appVersion.substring(0, 4);
this.platform = navigator.platform;
this.javaEnabled = navigator.javaEnabled();
this.screenWidth = screen.width;
@steveosoule
steveosoule / ie-conditionals.html
Created November 14, 2012 18:14
IE Conditionals
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="all-ie-only.css" />
<![endif]-->
<!--[if !IE]>
<link rel="stylesheet" type="text/css" href="not-ie.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="ie7.css">
@steveosoule
steveosoule / javascript-query-string-parameter-helpers.js
Last active February 12, 2016 05:27
JavaScript Query String Parameter Helpers
window.params = function(){
var params = {},
href = window.location.href,
param_array = ( href.indexOf('?') > -1 ) ? window.location.href.split('?')[1].split('&') : [];
for(var i in param_array){
x = param_array[i].split('=');
params[x[0]] = x[1];
}