Skip to content

Instantly share code, notes, and snippets.


Dan Burzo danburzo

View GitHub Profile
danburzo /
Last active Jan 19, 2016
Draw every emoji
danburzo / smartypants.js
Last active Nov 9, 2016
Smartypants in JavaScript
View smartypants.js
function smartypants(str) {
Rules adapted from:
return [
[/(^|[-\u2014\s(\["])'/g, "$1\u2018"], // opening single quote
[/'/g, "\u2019"], // closing single quote, apostrophe
[/(^|[-\u2014/\[(\u2018\s])"/g, "$1\u201c"], // opening double quote
[/"/g, "\u201d"], // closing double quote
danburzo / index.js
Created Feb 25, 2017
Find the WordPress themes & plugins used by a page
View index.js
function _match(str, regex) {
var matches = [];
str.replace(regex, function() {
return matches;
function _unique(item, idx, arr) {
return arr.indexOf(item) === idx;
danburzo /
Last active Jun 10, 2018
Duplicate pinboard bookmarks

Finding duplicate Pinboard bookmarks.

Run this Node script against your exported JSON file, which you'll need to enter in the FILEPATH variable.

The keyfor method returns the relevant part of the URL. You can customize it based on the available properties.

danburzo / youtube-favorites.js
Created Jul 18, 2018
Grab a JSON of your YouTube favorite videos (or any other playlist)
View youtube-favorites.js
Get your Youtube favorite videos
1. Navigate to your Favorites page
2. Scroll the list all the way down such that all videos are loaded into the browser.
3. Copy the JavaScript code below and run it in your console; a JSON of your videos
will be loaded into your clipboard.
4. Paste into a file on your computer.
View normalize_offsets.js
const normalize_offsets = offsets => {
let arr = offsets.slice();
if (arr[0] === undefined) arr[0] = 0;
if (arr[arr.length - 1] === undefined) arr[arr.length - 1] = 1;
let i = 0, j, start, start_offset, increment;
while (i < arr.length) {
if (arr[i] === undefined) {
start = i;
start_offset = arr[i - 1];
j = i;
danburzo / debug.css
Last active Sep 11, 2019
Hover-aware CSS debug styles.
View debug.css
Hue rotaton based on the DOM element depth.
* { --hue: 0; }
* * { --hue: 60; }
* * * { --hue: 120; }
* * * * { --hue: 180; }
* * * * * { --hue: 240; }
* * * * * * { --hue: 300; }
* * * * * * * { --hue: 0; }
danburzo /
Last active Apr 24, 2020
Scrape your Facebook saved links

Facebook does not provide an easy way to get your saved links out of its system. Here's a quick script that does that for you.


Go to your Saved links page and make sure you scroll way down to the bottom so that all your saved items are loaded. This script will generate a simple HTML page with your links, along with an Add to Pinboard action.


Drag this to your bookmarks toolbar: <a href='javascript:eval(unescape("//%20selector%20for%20accessing%20the%20links%0A//

danburzo /
Last active Jun 30, 2020
Highlight CSS stacking contexts on a web page

Highlight the CSS stacking contexts on a page.

This has been incorporated in a small library.

How to use

Paste the content of the stacking-contexts.js file into the browser's dev tools. Elements that (at least in theory) are stacking contexts will be highlighted with a red border / overlay. The elements' title attribute will reflect the reason and the z-index.

Note: in a browser that does not support a certain CSS property — e.g. Safari with contain — the property will not show up in the element's computed styles, so running this code in Safari will not highlight an object with contain: content as a stacking context. Make sure to test in a variety of browsers to track down differences.

danburzo /
Last active Jun 30, 2020
Find elements that poke outside window bounds
You can’t perform that action at this time.