Skip to content

Instantly share code, notes, and snippets.

@zinkkrysty
zinkkrysty / -1520868841710.log
Created March 12, 2018 15:49
Atom Github preview diff pane error
<embedded>:121087 IntersectionObserver.observe(target): target element is not a descendant of root.
TreeView @ <embedded>:121087
<embedded>:25811 Enabled theme 'no-caffeine-syntax' is not installed.
warnForNonExistentThemes @ <embedded>:25811
<embedded>:267185 Uncaught (in promise) Error: RelayModernGraphQLTag: Expected an request, got `{"fragment":{"argumentDefinitions":[{"kind":"LocalArgument","name":"prUrl","type":"URI!","defaultValue":null}],"kind":"Fragment","metadata":null,"name":"PrInfoControllerByUrlQuery","selections":[{"kind":"LinkedField","alias":null,"args":[{"kind":"Variable","name":"url","variableName":"prUrl","type":"URI!"}],"concreteType":null,"name":"resource","plural":false,"selections":[{"kind":"FragmentSpread","name":"PrSelectionByUrlContainer_resource","args":null}],"storageKey":null}],"type":"Query"},"id":null,"kind":"Batch","metadata":{},"name":"PrInfoControllerByUrlQuery","query":{"argumentDefinitions":[{"kind":"LocalArgument","name":"prUrl","type":"URI!","defaultValue":null}],"kind":"
function countNodes(elem) {
const nodeCount = elem.getElementsByTagName('*').length;
elem.setAttribute('data-nodes', nodeCount);
[].slice.call(elem.children).forEach(countNodes);
}
@zinkkrysty
zinkkrysty / resolution_regex.md
Last active September 15, 2020 09:05
Screen resolution regular expression for Google Analytics

/^([0-9].*)x([1-8][0-9][0-9])$/

@zinkkrysty
zinkkrysty / padded_box_helper.rb
Created December 18, 2012 10:35
Automatic padding of bounding box in Prawn, and allows for filling in the background color. Currently only when specifying height, but I'm open to suggestions.
require 'prawn'
module PaddedBoxHelper
#
# Fills the background of the box you're in
#
def fill_bg_color color
float do
fill_color color