Skip to content

Instantly share code, notes, and snippets.

View jarek-foksa's full-sized avatar

Jarek Foksa jarek-foksa

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.boxy_svg.BoxySVG</id>
<name>Boxy SVG</name>
<summary xml:lang="de">Editor für skalierbare Vektorgrafiken</summary>
<summary>Scalable Vector Graphics editor</summary>
<summary xml:lang="es">Editor de gráficos vectoriales</summary>
<summary xml:lang="pl">Edytor grafiki wektorowej</summary>
<description>
<p xml:lang="de">Das Projektziel von Boxy SVG ist es, das beste Tool für die Bearbeitung von SVG-Dateien zu schaffen. Sowohl
// @copyright
// © 2012-2022 Jarosław Foksa
// © 2015 Hugh Kennedy
//
// @license
// MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without
import ChildProcess from "child_process";
// @info
// Fetch a package from NPM registry without downloading any dependencies or executing any scripts.
// @type
// (string, string) => void
let fetchPackage = (name, version, tempPath, directory = `deps/${name}`) => {
return new Promise((resolve, reject) => {
let npmProcess = ChildProcess.spawnSync(
"npm",
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg">
<rect x="142.476" y="149.468" width="168.714" height="151.346" style="fill: rgb(216, 216, 216);"/>
</svg>
@jarek-foksa
jarek-foksa / full_example.html
Last active May 25, 2019 17:29
canvas issue
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="node_modules/xel/themes/material.css">
<script src="node_modules/xel/xel.min.js"></script>
<style>
body, html{
height: 100%;
width: 100%;
}
@jarek-foksa
jarek-foksa / index.html
Last active July 7, 2020 13:42 — forked from SMotaal/README.md
Electron 2.x demo app that demonstrates how to enable ES modules support.
<!DOCTYPE html>
<html>
<head>
<base href="app://./" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' app:; object-src 'self' app:;">
<script type="module" src="./module.js"></script>
</head>
<body>
Check the console!
// @info
// Takes normalized path data and harmonizes it so that each subpath starts with "M" seg, followed by one or
// more "C" or "L" segs, optionally followed by "Z" seg.
let harmonizePathData = (pathData) => {
if (!pathData.find(($0) => $0.type === "C" || $0.type === "L")) return [];
let simplifiedPathData = [];
let lastType = null;
let currentX = 0;
/**
* @copyright
* © 2016 Scott Hyndman
* @doc
* https://material.google.com/material-design/elevation-shadows.html
* https://docs.google.com/document/d/1W3NGSLqDZzjbBBLW2C6y_6NUxtvdZAVaJvg58LY3Q0E/preview#
* @src
* http://codepen.io/shyndman/pen/ojxmdY
* http://codepen.io/shyndman/pen/MaYoaV
// @copyright
// © 2009-2012 Nicholas C. Zakas
// © 2012-2016 Jarosław Foksa
//
// @doc
// https://drafts.csswg.org/css-syntax
//
// @info
// CSS tokenizer based on TokenStream.js and Tokens.js from CSSLint.
// @copyright
// © 2005, 2006, 2013 Apple Inc. All rights reserved.
// © 2009 Torch Mobile, Inc.
// © 2016 Jarosław Foksa
// @src
// https://drafts.csswg.org/css-transforms-1/#recomposing-to-a-3d-matrix
// http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
let {abs, sqrt, asin, sin, cos, tan, atan2} = Math;