This file contains hidden or 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
tumblr.getCssMap().then(cssMap => { | |
const keys = Object.keys(cssMap); | |
const elements = document.querySelectorAll("[class]"); | |
for (const {classList} of elements) { | |
for (const className of classList) { | |
const mappedClassName = keys.find(key => cssMap[key].includes(className)); | |
if (mappedClassName) classList.add(`tumblr--${mappedClassName}`); | |
} | |
} | |
}); |
This file contains hidden or 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
# Converts ounces per linear yard (a common measurement of fabric density in | |
# North America) to GSM (grams per square meter). | |
# | |
# When buying fabric, a "linear yard" refers to a yard-long piece of fabric cut | |
# from a bolt. Ounces per linear yard are calculated by weighing a bolt of | |
# fabric, then dividing its weight by its length in yards when fully unspooled. | |
# Fabric bolts may be of varying heights, but are generally more than 1 yard | |
# tall; 4-5 feet is a common height. | |
# | |
# (Q) Given this variability in bolt size, why do so many vendors describe |
This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Autocomplete Example - JQuery UI</title> | |
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> | |
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.min.js" integrity="sha256-eTyxS0rkjpLEo16uXTS0uVCS4815lc40K2iVpWDvdSY=" crossorigin="anonymous"></script> | |
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css" integrity="sha256-WKb0npL30v0SRtmMVowqx9a+gy3f7OZ+yffvMzJ2at8=" crossorigin="anonymous"> |
This file contains hidden or 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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\exefile\shell\WindowsFirewall] | |
@="" | |
"MUIVerb"="Windows Firewall" | |
"icon"="%SystemRoot%\\system32\\FirewallControlPanel.dll,0" | |
"subcommands"="" | |
[HKEY_CLASSES_ROOT\exefile\shell\WindowsFirewall\Shell] | |
@="" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
require 'watir' | |
require 'selenium-webdriver' | |
require 'logger' | |
# Selenium::WebDriver::Error.constants | |
# => [:WebDriverError, :NoSuchElementError, :NoSuchFrameError, ...] | |
def rescue_every_single_goddamn_webdriver_error | |
selenium_errors = Selenium::WebDriver::Error.constants.map do |e_symbol| | |
Selenium::WebDriver::Error.const_get(e_symbol) |
This file contains hidden or 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
<!-- | |
Note that this is a very rough, incomplete prototype. | |
More info on how to possibly leverage it here: https://github.com/tumblr/docs/issues/49 | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
{MobileAppHeaders} |
This file contains hidden or 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
require 'base64' | |
require 'fastimage' | |
# This is not raster-to-vector conversion; this is putting a raster in a vector | |
# suit. If you find yourself in need of this information, something is very | |
# wrong. Something is very wrong. | |
def embed_raster_image_in_svg(input_image ="raster.jpg", | |
output_image="raster_in_vector.svg") | |
dimensions = FastImage::size(input_image) |
This file contains hidden or 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
module Enumerable | |
# Sources: | |
# - https://stackoverflow.com/a/15442966/797772 | |
# - https://rubygems.org/gems/vex/versions/0.6.2 | |
def stable_sort_by | |
sort_by.with_index { |x,idx| [yield(x), idx] } | |
end | |
# def stable_sort_by |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Steps used September 2021 to get Zoneminder working on Ubuntu 18.04 with a | |
# Reolink RLC-410W camera. | |
# Install dependencies: | |
sudo apt-get install tasksel | |
sudo tasksel install lamp-server |