Skip to content

Instantly share code, notes, and snippets.

View simpleneeraj's full-sized avatar
😝
Chill

Simple Neeraj simpleneeraj

😝
Chill
View GitHub Profile
@nikitaeverywhere
nikitaeverywhere / cloneNodeDeepWithStyles.js
Created May 13, 2017 14:27
Deep node clone node with styles cloning
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;
}
@robertpeteuil
robertpeteuil / GitHub Language Colors in CSS and JSON
Last active June 14, 2024 19:29
GitHub Language Colors in CSS and JSON
This Gist contains the GitHub Language colors in CSS and JSON formats in seperate files.
@nitrag
nitrag / Screenshot.swift
Created November 21, 2016 05:16
This will allow you to take a screenshot of a UIView, but more importantly only a section of that view
//
// 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