Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<trizbort version="1.5.9.2">
<info />
<map>
<room id="1" name="A Way In!" subtitle="" x="-1536" y="2400" w="96" h="96" region="NoRegion" handDrawn="no" ellipse="no" roundedCorners="no" cornerTopLeft="15" cornerTopRight="15" cornerBottomLeft="15" cornerBottomRight="15" borderstyle="Dot" description="" roomFill="" secondFill="" secondFillLocation="Bottom" roomBorder="" roomLargeText="" roomSmallText="" />
<room id="2" name="" subtitle="" x="-1536" y="2592" w="96" h="96" region="NoRegion" handDrawn="no" ellipse="no" roundedCorners="no" cornerTopLeft="15" cornerTopRight="15" cornerBottomLeft="15" cornerBottomRight="15" borderstyle="Solid" description="" roomFill="" secondFill="" secondFillLocation="Bottom" roomBorder="" roomLargeText="" roomSmallText="" />
<line id="3" startText="down" endText="up">
<dock index="0" id="1" port="ssw" />
<dock index="1" id="2" port="nne" />
</line>
@PlNG
PlNG / gist:6128259
Created August 1, 2013 03:46
Regular Expressions to fix JavaScript Lint Warnings (JSLint, JSHint, etc.) for fast fixes for mass issues.
// WIP: Pretty much all of them need work.
// TODO: Eventually remove the need for JSBeautify pretty printing / space sensitivity.
// Unexpected 'in'. Compare with undefined, or use the hasOwnProperty method instead.
// TODO: detect if it is a "for in" line and ignore.
// UNSTABLE: Matches for (foo in bar).
Match: ("?[\w\._]+"?) in ([\w\._]+)
Replace: \2.hasOwnProperty\(\1\)
@PlNG
PlNG / changeElement.js
Created January 26, 2013 20:05
Initial commit: changeElement. Convert one html element to another in JavaScript. No native method to do it, but can be done with native methods. Arguments are an element and a tag name. Internally the element is cloned, a new element is created with the tag name, attributes and child nodes are copied, the new element is normalized, the clone is…
function changeElement(element, tagName) {
"use strict";
/**
* Dependencies: document
* Change an html element from one tag to another.
* @param {!Object} element An HTML Element.
* @param {string} tagName the tag name to change your element to.
*/
if (!document || typeof element !== "object" || typeof tagName !== "string") {
throw new Error("changeElement: Expected this function to run within an environment containing the 'document' global variable, Element to be an HTML Element and tagName to be a string. document=" + Boolean(document) + " typeof element=" + typeof element + " typeof tagName=" + typeof tagName);