Skip to content

Instantly share code, notes, and snippets.

View poggs's full-sized avatar

Peter Hicks poggs

View GitHub Profile
<html>
<head>
<!--
Amazon S3 Bucket listing.
Copyright (C) 2008 Francesco Pasqualini
This program is free software: you can redistribute it and/or modify
@lakenen
lakenen / importNode.js
Created March 14, 2013 21:55
document.importNode shim for IE <= 9. Started with http://stackoverflow.com/questions/1811116/ie-support-for-dom-importnode/9883539#9883539, modified to fix issues (http://stackoverflow.com/questions/14593520/ie9-importing-inline-svg-image-elements-broken) with importing image nodes and other nodes with namespaced:attributes
function importNode(node, allChildren, doc) {
var a, i, il;
doc = doc || document;
try {
return doc.importNode(node, allChildren);
} catch (e) {
switch (node.nodeType) {
case document.ELEMENT_NODE:
var newNode = doc.createElementNS(node.namespaceURI, node.nodeName);
if (node.attributes && node.attributes.length > 0) {
@OpenGrid
OpenGrid / twitter-bootstrap-forms-responsive.css
Created July 24, 2012 15:19
Twitter Bootstrap form-horizontal css for form for two column layout
@media (max-width: 980px) {
.form-horizontal .control-group > label {
float: none;
width: auto;
padding-top: 0;
text-align: left;
}
.form-horizontal .controls {
margin-left: 0;
}
@kmile
kmile / xml_parser.rb
Created February 15, 2011 12:53
A small nokogiri xml reader DSL.
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#