This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deepCloneWithStyles (node) { | |
const style = window.getComputedStyle(document.body, null); | |
const clone = node.cloneNode(false); | |
if (clone.style && style.cssText) | |
clone.style.cssText = style.cssText; | |
for (let child of node.childNodes) | |
clone.appendChild(deepClone(child)); | |
return clone; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This Gist contains the GitHub Language colors in CSS and JSON formats in seperate files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Screenshot.swift | |
// | |
// 1) Take a picture of a UIView | |
// 2) Take a picture of a UIView's subframe. EG. Fullscreen UIView with a | |
// small square box in the middle, it will only save what's visible in the box frame | |
// but not the box itself | |
import Foundation | |
import UIKit |