Skip to content

Instantly share code, notes, and snippets.

View oscarmarina's full-sized avatar

Oscar Marina oscarmarina

  • BBVA
  • Madrid, Spain
View GitHub Profile
//ShadyCSS.styleDocument();
<script>
if (window.customElements) window.customElements.forcePolyfill = true;
window.ShadyDOM = { force: true };
window.ShadyCSS = { shimcssproperties: true };
</script>
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
quote_type = single
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
async firstUpdated () {
const children = this.shadowRoot.querySelectorAll('*'));
await Promise.all(Array.from(children).map((c) => c.updateComplete));
this.onceChildrenAreUpdated();
}
//https://stackoverflow.com/questions/58035998/run-a-function-once-all-children-element-are-actually-updated
//https://github.com/Polymer/lit-element/issues/155
const resolveDoc = document.createElement('a');
export const getAbsoluteUrl = url => {
if (url && (url.indexOf('://') > 0 || url.indexOf('//') === 0)) {
return url;
}
resolveDoc.href = url;
return resolveDoc.href || url;
};
npx envinfo --system --npmPackages vite --binaries --browsers
firstUpdated(changedProps) {
super.firstUpdated && super.firstUpdated(changedProps);
this.__slotsDom = Array.from(this.shadowRoot.querySelectorAll('slot')).reduce(
(previous, curren) => {
Object.assign(previous, { [curren.name]: curren.parentNode });
return previous;
},
{},
);
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.42 53.57" style="fill: currentColor; fill-rule: evenodd;">
<g>
<path
d="M44.42,37.3A16.54,16.54,0,0,1,42.16,46a14.2,14.2,0,0,1-6.88,5.73,18.93,18.93,0,0,1-5.8,1.47,58.76,58.76,0,0,1-6,.33H22.18a11.2,11.2,0,0,1-1.3-.08q-5.25-.21-10.58-.21c-1.35,0-2.69.06-4,.18s-2.71.18-4.1.18a.66.66,0,0,1-.5-.25.8.8,0,0,1-.22-.54.94.94,0,0,1,.68-1.05,15,15,0,0,1,1.62-.32,3.32,3.32,0,0,0,1.73-.87,4.06,4.06,0,0,0,.94-2.73c0-.58.07-1.15.07-1.73V44.35q0-9.14,0-18.25t0-18.25c0-2.11-.36-3.41-1.08-3.89a7.88,7.88,0,0,0-4-.72,1.29,1.29,0,0,1-.9-.36A1.11,1.11,0,0,1,0,2C0,1.1.5.65,1.51.65s2,0,3,.14,2,.15,3,.15q3.66,0,7.34-.26T22.1.14c.48,0,.95-.08,1.41-.1s.9,0,1.33,0a29.73,29.73,0,0,1,7.74,1,11.62,11.62,0,0,1,5.9,3.57C40,6.26,40.75,8.76,40.75,12a10.4,10.4,0,0,1-1.47,5.33,14,14,0,0,1-3.71,4.18A8.08,8.08,0,0,1,34,22.64q-.85.48-1.8.9l-.54.26c-.26.12-.39.27-.39.46s.13.26.39.33a2.7,2.7,0,0,1,.54.18c.77.19,1.52.39,2.24.61a12.38,12.38,0,0,1,2.16.9,16.09,16.09,0,0,1,5.58,4.39A10
@oscarmarina
oscarmarina / cairos.sh
Last active September 16, 2021 08:12
CairoSVG Convert your SVG files to PDF and PNG - from a directory
# Use cairosvg from a directory, optionally specifying the IN (default:SVG) and OUT(default:PDF)
# Usage default (.svg to .pdf): cairos
# Usage with out: cairos .png
# https://www.rexfeng.com/blog/2018/08/using-svg-pdf-assets-in-your-ios-app/
function cairos() {
local out="${1:-.pdf}"
for i in *.svg; do
echo $i "==" $i$out
cairosvg $i -o $i$out
done
@oscarmarina
oscarmarina / rvm-openssl@3.txt
Last active August 2, 2024 18:25
rvm openssl@3
https://github.com/rvm/rvm/issues/5380
const colors = {
reset: '\x1b[0m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
bright: '\x1b[1m',
white: '\x1b[37m',
grey: '\x1b[90m',
};