Skip to content

Instantly share code, notes, and snippets.

ENV["I_LIKE_METHOD_ALIAS_CHAIN"] = "true"
require 'rubygems'
require 'haml'
# performance optimizations.
load 'paml.rb'
require 'hoe'
<html><head><title/></head><body><style type="text/css">
body {
background:#333;
}
div {
width:100px;
height:100px;
position: absolute;
top: 50px;
left: 300px;
<!--
Shows the areas defined by image maps.
Probably only works with poly & rect shapes at the moment.
Click a shape to see attributes.
I may create a bookmarklet from this if I get motivated enough.
-->
<script src="http://jscdn.net/jquery.js" type="text/javascript"></script>
<script src="http://jscdn.net/raphael.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
# Tweets the currently playing song from iTunes
# Requirements:
# Grackle: http://github.com/hayesdavis/grackle/tree/master
# rb-itunes: http://rubyforge.org/projects/rb-itunes/
require 'rubygems'
require 'rb-itunes'
require 'grackle'
@@delay = 1 # in seconds
A couple of examples of lists copied & pasted from Word into a browser-based WYSIWYG editor.
Ordered lists:
<p class="MsoListParagraphCxSpFirst" style="text-indent: -18pt;"><!--[if !supportLists]--><span style="" lang="EN-AU"><span style="">1.<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><!--[endif]--><span lang="EN-AU">Point 1</span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -18pt;"><!--[if !supportLists]--><span style="" lang="EN-AU"><span style="">2.<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><!--[endif]--><span l
<!DOCTYPE html >
<html lang="en-au">
<head>
<title>HTML5 Shiv Test</title>
<!-- Which is worse? Inlined script or extra HTTP request? Only the llama knows. -->
<!--[if lte IE 8]><script type="text/javascript">var e=['abbr','article','aside','audio','canvas','details','figcaption','figure','footer','header','hgroup','mark','menu','meter','nav','output','progress','section','summary','time','video'],i=21,d=document;while(i--)d.createElement(e[i])</script><![endif]-->
<style type="text/css">
section { display: block; padding: 0 1em; border: 3px solid #0c0; background: #cfc; color: #0a0; }
</style>
</head>
cat /dev/urandom > index.html
var PROJECT_NAME = (function($){
// Self
var _this = {};
// Puublic methods
_this.init_body = function(){
$('body').addClass('js-enabled');
};
if(typeof console === 'undefined'){
var console = {
log: function(s){
var $d = $('#debug-panel');
if(!$d[0]){
$d = $('<div id="debug-panel" style="height:300px;overflow: auto;border: 1px solid #000;padding:10px;font-family:monospace;"></div>').appendTo('body');
}
$d.html($d.html() + '<br/>' + s);
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>hAiku</title>
<style>
[itemprop=hAiku] { font-size: 3em; margin: 1em 0; }
[itemprop=hAiku] [itemprop=kireji], [itemprop=hAiku] [itemprop=cutting] { font-weight: bold; color: #500; }
[itemprop=hAiku] [itemprop=kigo], [itemprop=hAiku] [itemprop=season] { font-style: italic; color: #500; }