Skip to content

Instantly share code, notes, and snippets.

View marcobiedermann's full-sized avatar
:octocat:
git push origin main -fu

Marco Biedermann marcobiedermann

:octocat:
git push origin main -fu
View GitHub Profile
{
"version": "0.0.8",
"name": "@marcobiedermann/resume.json",
"main": "resume.json"
}
@marcobiedermann
marcobiedermann / max-char.ts
Created August 16, 2022 07:27
Given a string, return the character that is most commonly used in the string.
function maxChar(str: string): string {
const map = new Map<string, number>();
let maxValue;
let maxCount = 0;
for (let char of str) {
const newCount = (map.get(char) || 0) + 1;
if (newCount > maxCount) {
maxValue = char;
// your existing code …
console.log(legalFollowUpSalesLiableProcessViewDtoList);
console.log(userName);
console.log(userId);
console.log(userCity);
// please add these lines and try if this shows something
legalFollowUpSalesLiableProcessViewDtoList.legalFollowUpProcessViewDto.push({
authorityOfficeName: 'volkantest',
});
import React, { ReactNode } from 'react'
interface ProjectProps {
children: ReactNode;
name: string;
}
function Project(props: ProjectProps): JSX.Element {
const { children, name } = props;
@marcobiedermann
marcobiedermann / structure.md
Created May 19, 2022 13:47
React Project Structure

Folder Structure

Structure by features/domain

.
└── src
    └── features
        ├── orders
 │   ├── Orders.tsx
@marcobiedermann
marcobiedermann / docker.md
Created December 10, 2019 08:09
Clean up docker images, containers and volumes

Stop all Docker container

docker stop $(docker ps -aq)

Remove all Docker container

docker rm $(docker ps -aq)
// https://gist.github.com/rosszurowski/67f04465c424a9bc0dae
function lerpColor(a, b, amount) {
var ah = parseInt(a.replace(/#/g, ""), 16),
ar = ah >> 16,
ag = (ah >> 8) & 0xff,
ab = ah & 0xff,
bh = parseInt(b.replace(/#/g, ""), 16),
br = bh >> 16,
bg = (bh >> 8) & 0xff,
bb = bh & 0xff,
@marcobiedermann
marcobiedermann / promise.js
Last active October 18, 2019 20:27
Promise Cheatsheet
// await must only be used if you want to execute something after promise to await the result
const createdUser = await createUser();
const user = await getUser();
// async must be used in function if you want to await something
(async () => {
await foo();
})()
@marcobiedermann
marcobiedermann / google.md
Created February 11, 2018 19:19
Google Search Parameters

Search in URL

inurl:

Seach in Title

intitle:
@marcobiedermann
marcobiedermann / git.md
Last active June 25, 2023 13:47
Cheatsheet of git commands

Get status

git status

Add file to staging area

git add FILE