Skip to content

Instantly share code, notes, and snippets.

View spetex's full-sized avatar

Petr Sahula spetex

View GitHub Profile
#!/bin/sh
# /etc/acpi/default.sh
# Default acpi script that takes an entry for all actions
set $*
group=${1%%/*}
action=${1#*/}
device=$2
id=$3
@spetex
spetex / transformParse.js
Last active August 29, 2019 09:14
Functions for parsing and stringifying svg transform
// const test = 'translate(20, -10) scale(-2) rotate (-30, -10, -90)'
// const test = 'translate(0,-343.82039245605483) scale(1.6900000000000002)';
const test = 'fsfssd fdsfs';
console.log(parseTransform(test));
console.log(transformToString(parseTransform(test)));
function parseTransform(transformString) {
if (!transformString || !['rotate', 'scale', 'translate'].includes(attr => transformString.contains(attr))) {
return null;
}
@spetex
spetex / index.re
Created November 28, 2018 16:46 — forked from rusty-key/index.re
Reason HMR
[@bs.val] [@bs.scope ("module")]
external isHotEnabled : bool = "hot";
[@bs.val] [@bs.scope ("module", "hot")] external hotAccept : unit => unit = "accept";
ReactDOMRe.renderToElementWithId(<App />, "root");
if (isHotEnabled) {
hotAccept();
}