Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carly31
carly31 / code
Created May 31, 2019 06:02
Center svg
//remove width attribute
//remove height attribute
<svg
viewBox="0 0 1920 1080"
preserveAspectRatio="xMidYMid meet">
</svg>
/* source: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio */
@carly31
carly31 / branch-fu.md
Created May 27, 2019 03:02 — forked from unbracketed/branch-fu.md
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
var bgColor = getComputedStyle(document.body).getPropertyValue('--bgColor');
var color = "--sliderBg: blue;";
frame_slider.setAttribute("style", color);
TRACK
-moz-range-track
-webkit-slider-runnable-track
-ms-track (or used -ms-fill-upper & -ms-fill-lower)
THUMB
-moz-range-thumb
-webkit-slider-thumb
-ms-thumb
var linkTags = window.parent.document.getElementById("basefonts");
var newLink = document.createElement("link");
newLink.rel = linkTags.rel;
newLink.href = linkTags.href;
document.head.appendChild(newLink);
var streamCompress_tag = /<div(.*)div>/gim;
1. loadstart
2. durationchange
3. loadedmetadata
4. loadeddata
5. progress
6. canplay
7. canplaythrough
var arr = Array.prototype.slice.call( htmlCollection )