Skip to content

Instantly share code, notes, and snippets.

View kissu's full-sized avatar
🌱

Konstantin BIFERT kissu

🌱
View GitHub Profile
@kissu
kissu / wagon_race.js
Created February 14, 2025 17:33
Wagon Race
// TODO: write your code here
const moveForward = (player) => {
const wagon = document.querySelector(`#player${player}-race .active`);
if (wagon.nextElementSibling) {
wagon.nextElementSibling.classList.add('active');
wagon.classList.remove('active');
} else {
alert(`Player ${player} wins! Play again?`);
window.location.reload();
}
@kissu
kissu / inbox.js
Created February 13, 2025 18:05
Fake inbox
/* eslint-disable no-multiple-empty-lines */
/* eslint-disable prefer-const */
/* eslint-disable import/extensions */
import runChallenges from "../spec/inbox_examiner.js";
const hasNewMessage = () => {
// TODO: return true with a probability of 20%.
return Math.random() < 0.2;
};
@kissu
kissu / index.html
Created February 13, 2025 17:02
Form validation (a bit hardcore but it's okay ❤️‍🩹)
<!DOCTYPE html>
<html>
<head>
<title>Form Validation</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="data:image/x-icon;" type="image/x-icon">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
@kissu
kissu / button.css
Created February 11, 2025 21:26
And example of a possible Dribble bucket integration
.btn-green {
text-decoration: none;
background-color: #3DBF59;
padding: 8px;
margin-top: 8px;
color: white;
width: 100%;
display: inline-block;
text-align: center;
}
@kissu
kissu / index.html
Created February 10, 2025 17:29
Dribble copycat
<html>
<head>
<title>Dribbble card</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="card-container">
@kissu
kissu / acronym.rb
Created January 23, 2025 21:06
Yield day with plenty of iterators + RSpec
def acronym(sentence)
return sentence.split.map { |word| word[0] }.join.upcase
end
@kissu
kissu / acronym.rb
Last active January 23, 2025 09:35
def acronym(sentence)
# we split the sentence into words
# grab first letter of each word
# join the first letters
final = []
array_of_words = sentence.split(' ')
array_of_words.each do |word|
final << word[0].upcase
# p final
@kissu
kissu / coach_answer.rb
Created January 21, 2025 17:20
Programming Basics
def coach_answer(your_message)
if your_message.upcase == "I AM GOING TO WORK RIGHT NOW!"
return ""
elsif your_message.end_with?("?")
return "Silly question, get dressed"
else
return "I don't care"
end
end
{
mode: 'development',
context: '/Users/kissu/code/vue3-webpack',
output: {
hashFunction: 'xxhash64',
path: '/Users/kissu/code/vue3-webpack/dist',
filename: 'js/[name].js',
publicPath: '/',
chunkFilename: 'js/[name].js'
},
@kissu
kissu / getProperty.js
Created January 7, 2021 15:44 — forked from jasonrhodes/getProperty.js
Get a nested object property by passing a dot notation string as the property name
/**
* A function to take a string written in dot notation style, and use it to
* find a nested object property inside of an object.
*
* Useful in a plugin or module that accepts a JSON array of objects, but
* you want to let the user specify where to find various bits of data
* inside of each custom object instead of forcing a standardized
* property list.
*
* @param String nested A dot notation style parameter reference (ie "urls.small")