Skip to content

Instantly share code, notes, and snippets.

View babangsund's full-sized avatar
🚀

Benjamin Bangsund babangsund

🚀
View GitHub Profile
@babangsund
babangsund / toFigmaVariables.js
Last active July 14, 2023 01:17
Cloudscape variables to figma variables
/**
* Converts Amazon Cloudscape variables to the [figma token format](https://design-tokens.github.io/community-group/format/).
* Assuming use of [this plugin](https://github.com/microsoft/figma-variables-import).
*
* - Classic palette: https://github.com/cloudscape-design/components/blob/main/style-dictionary/classic/color-palette.ts
* - VR palette: https://github.com/cloudscape-design/components/blob/main/style-dictionary/visual-refresh/color-palette.ts
* - VR colors: https://github.com/cloudscape-design/components/blob/main/style-dictionary/visual-refresh/colors.ts
*
* Run this script with node and drag all 5 output files (at the same time!) into the figma plugin.
*/

NNNN - [short title of solved problem and solution]

  • Status: [proposed | rejected | accepted | deprecated | …]
  • Deciders: [list everyone involved in the decision]
  • Date: [YYYY-MM-DD when the decision was last updated]

Technical Story: [description | ticket/issue link]

Context and Problem Statement

@babangsund
babangsund / gist:5bc12b3b113b6bff49d3ef8445614b3c
Created May 8, 2021 02:30 — forked from sebsto/gist:19b99f1fa1f32cae5d00
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
@babangsund
babangsund / semVer.regex
Created August 21, 2019 20:50
RegEx for SemVer with numbered capture groups (ECMA, PCRE compatible)
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
@babangsund
babangsund / cherry-pick-rev.sh
Created July 9, 2019 18:55
Useful when cherry-picking a series of consecutive commits
function cherry-pick-rev() {
local branch
branch="cherry-pick/$1-$2"
git checkout -b $branch
git cherry-pick $(git rev-list --abbrev-commit --reverse $2 --not $1^1)
git checkout -
git merge --no-ff $branch
git branch -d $branch
}