Skip to content

Instantly share code, notes, and snippets.

View jorenbroekema's full-sized avatar
🦎
Bringing Style-Dictionary to new heights!

Joren Broekema jorenbroekema

🦎
Bringing Style-Dictionary to new heights!
View GitHub Profile
@jorenbroekema
jorenbroekema / gist:8bc3ee6909e44a429379fcd7a0e8c945
Last active May 29, 2025 13:56
Darken modifier tokens example from IDS talk
https://configurator.tokens.studio/#project=rVVbb5swFP4rFqsKTAnpNPWWKNMuXfe0l3VvJVIdcBK3xI5sk6ZC/PcdXyCGXqaqRYoC5/J9x9+xj6tAqjKnPLmVnAXjoEoZQmnAyvWcCJkGY2Qs2nagHjZEWxp3GgwaX47FHWHf1rxk6juWxEs0qVtclMZ4lHw6tvb6yeRnE9OgckUlfbI6DRyk/rO4aZDxgj+/AuP1FjAvcHb3AvmHI/O0TG3i/Yoq8lLiwjyPE7nAbNnPPNYUnuURGsnPzj+fNGh7PB148p/kykqSWOYEuOpWAb8TL8hdP818+jrmk/djPnsd8+n7MZ+/jvnsjcz+Dk9ZHQwCQZZUKiKuLi5LlinKmYRTDGeYrjdcKHSlHgpyQY0Hiwe0EHyNQqmtw7w1h5OUuYQKNZCodtFfFYdq5NAOiZHMhwqWIxdcrGUns5RE/iELIgjLiGzz+2yjUtHCz/yhRXLBRrBbmVCuA1LWVBP1VhIbb8+YNNF/mwIj1xqG12Ts0EdW3tD1Qc8DcJmutTadTxXdgkeJkjjzghYAPkaRUSRG0y/IvCVmqKDpdOooQnR46FyWzMfVdXUwvO1DFyjqyhj5MHHsB+tnNEK5jt1DYy3GAN0TxAjJkVpRCT11cPAmebEleRdFEFUKhkoGWJSRfLJ311rn5iOD/aVQVgg0BfR72zlXod338aQfbSu/ZJASZZyL3Kz5N1arZI130dEAGSsadgRDH63Z9tlfrXWrFawFLdHchlGGFZH7wOtQhINwCb95OEtAlp84W0W7ntqmyEIkkqjoRorlPDmodvXNoK05Ml5wXO9mceyJEveqssKjOVwgsAy0Iru924mroRS/UoKyZVS5DNh4EBsC4KQ93PAOJxvEW9Bl70qWvBSZmS3XzRXiXd12Uszc3bcpsDJntHP9ZVL2rpt24/wSvNy4m1FHDZ6IkR63A/SOVG+2KTly2013ez/HZh4yHCnSB+10CEYkkUr3l3I3J7cY
// 'Promise' --> the guarantee that some callback is running and doing things
// and that it will come back to you when it's done,
// either by succeeding or by failing.
const promise = new Promise((resolve, reject) => {
setTimeout(() => resolve('done!'), 2000); // increase this with 1 millisecond, and then the rejection happens before the resolution :o!
setTimeout(() => reject('failed'), 2000);
});
promise
@jorenbroekema
jorenbroekema / .editorconfig
Created September 6, 2019 14:38
Editor config
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
@jorenbroekema
jorenbroekema / lesson5.js
Last active March 18, 2019 12:25
Lesson Arrow functions, promises and async / await
// Arrow functions
let addFunction = function(a, b) {
return a + b;
}
// these are different ways to write functions, with only very minor differences
addFunction = function(a, b) { return a + b };
addFunction = (a, b) => { return a + b };
addFunction = (a, b) => a + b ;
@jorenbroekema
jorenbroekema / lesson.js
Last active March 5, 2019 21:11
Showcasing JS Objects, functions, template literals and arrow functions
/**
*
* 1) OBJECTS YAY!!!
*
*/
const animals = {
'turtle': '🐢',
'unicorn': '🦄',
}
@jorenbroekema
jorenbroekema / fizzbuzz.js
Created February 3, 2019 15:21
Quick fizzbuzz examples different levels
// FIZZBUZZ Simple
for (var i = 1; i <= 100; i++) {
var fizz = 3;
var buzz = 5;
if (i % 3 === 0 && i % 5 === 0){
console.log('FizzBuzz');
} else if (i % 3 === 0) {
console.log('Fizz');
} else if (i % 5 === 0) {
@jorenbroekema
jorenbroekema / simpleRPS.js
Last active February 3, 2019 14:57
simple Rock paper scissors
let choices = ['paper', 'rock', 'scissors'];
let playerChoice = prompt('What will you play? rock, paper or scissors?');
let opponentChoice = choices[Math.floor(Math.random() * 3)];
if (playerChoice === opponentChoice) {
alert('Opponent had: ' + opponentChoice + '. DRAW!');
} else if (playerChoice === 'paper' && opponentChoice === 'rock') {
alert('Opponent had: ' + opponentChoice + '. YOU WON :)!');
} else if (playerChoice === 'paper' && opponentChoice === 'scissors') {
alert('Opponent had: ' + opponentChoice + '. YOU LOST :(!');
@jorenbroekema
jorenbroekema / rps.js
Created February 3, 2019 14:48
Rock paper scissors prompt game
alert('Welcome to the Rock Paper and Scissors game!');
playGame();
function playGame() {
var choice = prompt('What will you play? rock, paper or scissors?');
var opponentChoice = Math.ceil(Math.random() * 3);
switch(opponentChoice) {
case 1: opponentChoice = 'paper';
case 2: opponentChoice = 'rock';