Skip to content

Instantly share code, notes, and snippets.

View codepo8's full-sized avatar

Christian Heilmann codepo8

View GitHub Profile
@codepo8
codepo8 / sort-on-4.md
Created July 11, 2024 13:30
Quick code challenge - sorting on four

How do you sort a list of words on the 4th character of the word? What"s the shortest solution?

[ "strawberry", "helicopter", "wales", "acorn" ]

should be:

@codepo8
codepo8 / Star challenge.md
Last active June 3, 2024 12:10
Chainlink CODE100 challlenge

Chainlink challenge

chainlink logo

Given a string s, where * represents a star…

Remove the star along with its closest non-star character to its left in a single operation.

The task is to perform this operation until all stars have been removed and to return the string that remains.

@codepo8
codepo8 / CODE100-bunt-statt-braun.md
Last active April 1, 2024 04:51
CODE100 "#BuntStattBraun" puzzle

CODE100 Challenge #BuntStattBraun

In this challenge you get an HTML document that renders a lot of colourful hearts.

pile of colourful hearts

And you get a JSON object with the information about all the brown colours that were used:

[
@codepo8
codepo8 / modernmarkupify.js
Created March 14, 2024 16:08
modernmarkupify.js
/*
<section>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
<form>
<label for="tech">Add a technology</label>
<input type="text" name="tech" id="tech">
@codepo8
codepo8 / CSVtoJSon.js
Last active February 29, 2024 09:07
OK, here is my function to turn CSV into JSON - what's yours?
const csvToJSON = (csv) => {
const getcsvdata = (csv) => {
const csvRegex = /,(?=(?:(?:[^"]*"){2})*[^"]*$)/;
const trimQuotes = /^"|"$/g;
csv = csv.split(csvRegex).map(
h => h.trim().replace(trimQuotes, '')
);
return csv;
}
let lines = csv.split('\n');
@codepo8
codepo8 / AFD.svg
Last active February 22, 2024 08:59
Alte naive fuer Deutschland
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@codepo8
codepo8 / challenge.md
Last active February 2, 2024 13:12
The CODE 100 xxx-challenge

The CODE100 XXX challenge

It's not what you think… On the 29th of January CODE100 is coming to Amsterdam - you can get a ticket here to join the party and network or you can go the whole hog and apply as a challenger - remember, the winners get to the finals in July and last year's winner went home with 10,000 Euro prize money.

In any case, this time the puzzle is to celebrate Amsterdam and it's flag:

Flag of Amsterdam, two red bars with a black bar containing three white X

The challenge is to take a collection of 292 games of noughts and crosses (or Tic Tac Toe) and to find out how many were won by the player using the X like shown in this animation:

CODE100 Happy new year! Puzzle

Happy new year animation

Welcome to the first puzzle of 2024! To celebrate, we want you to take this dataset:

[
 0,0,0,121,231,143,195,118,216,