Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jason Karns jasonkarns

🏠
Working from home
View GitHub Profile
@jasonkarns
jasonkarns / Opera CSS filter
Created Sep 30, 2009
CSS filter for Opera
View Opera CSS filter
@media all and (-webkit-min-device-pixel-ratio:10000),
not all and (-webkit-min-device-pixel-ratio:0) {
/* 7.2 up */
head~body { /* 9 up */ }
:root { /* 9.5 up */ }
}
View RGBa-IE6-7.css
/* IE 7 and below: RGBa value in hex: aaRRGGBB */
* {
background:transparent;
zoom: 1;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FC8C8C8,endColorstr=#7FC8C8C8);
}
@jasonkarns
jasonkarns / Hacks
Created Oct 8, 2009
CSS filter for IE
View Hacks
/* IE6 only */
* html {}
/* IE7 only */
* + html {}
/* IE8 only */
/* IE6-7 */
@jasonkarns
jasonkarns / Inline-Block.css
Created Dec 2, 2009
Cross-Browser Inline-Block
View Inline-Block.css
/* Caveats:
- ib-block needs an explicit width
- if the whitespace between ib-block elements is not a problem, then the ib-container class isn't necessary.
- if Firefox 2 support is necessary, add display:-moz-inline-stack to the top of the .ib-block rule and wrap .ib-block's children in a div.
- The IE6/7 rules can be broken out into separate ie-only stylesheets included via conditional comments.
*/
.ib-block {
vertical-align:top;
display:inline-block;
@jasonkarns
jasonkarns / Utility.css
Created Feb 10, 2010
A set of base utility classes
View Utility.css
/* A set of base utility classes */
.hidden {
display:none;
}
.phark {
text-indent: -5000px;
overflow: hidden;
display:block;
}
@jasonkarns
jasonkarns / index.html
Created Feb 22, 2010
JS Templating that upholds separation of concerns
View index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>JSHTML</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.jshtml.js"></script>
<script type="text/javascript">
jQuery(function($){
$('script.jshtml').jshtml();
console.log(some_global);
@jasonkarns
jasonkarns / MooTools.jQuery.js
Created Mar 5, 2010
jQuery mutator for MooTools
View MooTools.jQuery.js
Class.Mutators.jQuery= function(jquery){
return jquery;
};
Class.Mutators.initialize = function(initialize){
return function(){
//console.log("add ", this.jQuery.method, " to jQuery");
jQuery.fn[this.jQuery.method] = function(){};
$splat(this.jQuery.helpers).each(function(name){
//console.log("add ", name, " as ", this[name], " to jQuery.", this.jQuery.method);
@jasonkarns
jasonkarns / YQL.html
Created Dec 15, 2010
Sample YQL demo
View YQL.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>YQL</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
(function($){
View radbox.ubiquity.js
CmdUtils.makeBookmarkletCommand({
name: "radbox",
url: "javascript:function%20addvid(){var%20d=document,%20z=d.createElement(%27scr%27+%27ipt%27),%20b=d.body;try%20{if(!b)%20throw(0);r=Math.floor(Math.random()*100+1);z.setAttribute(%27src%27,%20%27http://radbox.me/init/static/add.js?r=%27+r.toString());b.appendChild(z);}%20catch(e)%20{alert(%27Please%20wait%20until%20the%20page%20has%20loaded.%27);}}if(window.location.hostname.search(%27radbox%27)%20==%20-1)%20{addvid();}%20else%20{alert(%27You%20cannot%20use%20this%20bookmarklet%20in%20Radbox.%27);}void(0);"
})
View fiddle.css
#map{
background:url(/_layouts/images/advics.internet.branding/map.png) #FFFFFF;
height:448px;
position:relative;
}
#map ul {
list-style:none;
}
.maplocation {
position:absolute;