Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AMoreaux's full-sized avatar
🐨
Work in progress

Antoine Moreaux AMoreaux

🐨
Work in progress
View GitHub Profile
import {createSDTFEngine} from '@specifyapp/specify-design-token-format';
/**
* CREATE A GRAPH FROM SCRATCH
*/
const sdtfTokenTree = createSDTFEngine({})
// create two colors
sdtfTokenTree.mutation.addToken({
async function parse(tokens, { SVGO, SVGSpriter }) {
const svgo = new SVGO({
plugins: [{
cleanupAttrs: true
}, {
removeDoctype: true
}, {
removeXMLProcInst: true
}, {
removeComments: true
@AMoreaux
AMoreaux / icon-compressor-parser
Last active April 1, 2020 15:32
icon-compressor-parser
async function parse(tokens, { SVGO }) {
const svgo = new SVGO({
plugins: [{
cleanupAttrs: true
}, {
removeDoctype: true
}, {
removeXMLProcInst: true
}, {
removeComments: true
function parse(tokens) {
const numberOfVariation = 9;
const result = tokens.filter(token => token.name !== null).map((token) => {
const output = [];
const color = tinycolor(token.value).toRgb();
let tintNumber = (numberOfVariation - 1) / 2;
if (tintNumber) tintNumber = Math.ceil(tintNumber);
let shadeNumber = (numberOfVariation - 1) / 2;
if (shadeNumber) shadeNumber = Math.floor(shadeNumber);
const tintGap = 500 / (tintNumber + 1);
@AMoreaux
AMoreaux / robbyrussell.zsh-theme
Last active October 16, 2022 21:33
Override oh-my-zsh robbyrussell theme with number of unpushed commits
get_git_status() {
if [ -d ".git" ]; then;
upstream=`git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)`
if [ -z "$upstream" ]; then;
echo "%{$fg_bold[red]%}(No upstream)%{$reset_color%} "
else
count=`git log --oneline @{u}.. | wc -l | awk '{ print $1 }'`
if [ $count -gt 0 ]; then
echo "%{$fg_bold[red]%}($count)%{$reset_color%} "