This file contains 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
@mixin recolor($color: #000, $opacity: 1) { | |
$r: red($color) / 255; | |
$g: green($color) / 255; | |
$b: blue($color) / 255; | |
$a: $opacity; | |
// grayscale fallback if SVG from data url is not supported | |
$lightness: lightness($color); | |
filter: saturate(0%) brightness(0%) invert($lightness) opacity($opacity); |
This file contains 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
// This function is used for Vite.js build in use with badly exported CommonJS modules | |
// @see https://github.com/vitejs/vite/issues/2139 | |
function interopDefault<T>(value: T): T { | |
// all "vite build" modes (preview mode is in DEV mode) | |
return import.meta.env.PROD || import.meta.env.MODE === "preview" ? (value as any).default : value; | |
} | |
export { interopDefault }; |
This file contains 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
https://chocolatey.org/packages/chromium/#versionhistory | |
https://omahaproxy.appspot.com/ => Branch Base Position | |
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/ | |
https://developers.google.com/web/updates/2020 |
This file contains 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
C:\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -here -full-path |
This file contains 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
/* --- Strategies --- */ | |
//=> network ? save : cache | |
async function networkFirst(cacheName, fetchEvent) { | |
const request = fetchEvent.request; | |
let fetchResponse; | |
return fetch(request) | |
.then(response => toCache(cacheName, request, fetchResponse = response)) | |
.then(response => response |
This file contains 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
import time | |
from functools import wraps | |
# Use this function only if you need decorator parameters | |
def howmuchtime(limit=None): | |
def decorator(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
start = time.time() |
This file contains 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
Show hidden characters
{ | |
"cmd": ["tsc", "-p", "jsconfig.json"], | |
"file_regex": "^(.+?)\\((\\d+),(\\d+)\\): (.+)$", | |
"working_dir": "${project_path:${folder}}", | |
"selector": "source.js" | |
} |
This file contains 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
import Vue from "vue"; | |
// Create the event bus by creating a new Vue instance and | |
// binding it somehwere accessible. If you bind it to the | |
// Vue prototype, you can access it within your components | |
// like this: | |
// | |
// Emit an event | |
// this.$bus.$emit('myEvent', {data: true}) | |
// |
This file contains 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
function serialize(form) { | |
const inputs = form.querySelectorAll("input"); | |
const fields = {}; | |
for (const input of inputs) { | |
if (input.name && !input.disabled && input.type !== "file" && input.type !== "reset" && input.type !== "submit" && input.type !== "button") { | |
if ((input.type !== "checkbox" && input.type !== "radio") || input.checked) { | |
fields[input.name] = input.value; | |
} | |
} |
This file contains 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
function applyBeforeExit(doBefore) { | |
document.addEventListener("click", async (event) => { | |
// Test for left click. | |
if (event.button !== 0) { | |
return; | |
} | |
let element = event.target; | |
// Go up through the DOM tree to search for a link |
NewerOlder