Skip to content

Instantly share code, notes, and snippets.

Avatar

Jarek Foksa jarek-foksa

View GitHub Profile
View Boxy SVG.xml
<?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>
View full_example.html
<!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 Jul 7, 2020 — forked from SMotaal/README.md
Electron 2.x demo app that demonstrates how to enable ES modules support.
View index.html
<!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!
View harmonize-path-data.js
// @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;
View gist:74a8958fdb1598e4ec489341b56073d1
/**
* @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
View css-tokenizer.js
// @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.
View decomposed-transform.js
// @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;
View compile-script.js
let compileScript = (content, relPath) => {
let Compiler = traceur.syntax.Compiler;
let Options = traceur.util.Options;
let options = new Options(traceur.Compiler.prototype.defaultOptions);
options.setFromObject({
arrayComprehension: true,
asyncFunctions: true,
asyncGenerators: true,
forOn: true,
View compile-script.js
let compileScript = (content, relPath) => {
let Compiler = traceur.syntax.Compiler;
let Options = traceur.util.Options;
let options = new Options(traceur.Compiler.prototype.defaultOptions);
options.setFromObject({
arrayComprehension: true,
asyncFunctions: true,
asyncGenerators: true,
forOn: true,
View bx-starpath.js
// @copyright
// © 2015 Jarosław Foksa
import {createElement} from "../utils/dom";
import {round, sin, cos, degToRad, PI} from "../utils/math";
import {collapseWhitespace} from "../utils/string";
const STAR_PATH_DATA_ATTRIBUTES = [
"data-bx-cx",