Skip to content

Instantly share code, notes, and snippets.

View itsdevdom's full-sized avatar
🤓
Working hard or hardly working

Dominique Müller itsdevdom

🤓
Working hard or hardly working
View GitHub Profile
@itsdevdom
itsdevdom / settings.local.json
Created April 29, 2026 18:53
Claude Project Settings
{
"permissions": {
"allow": [
"Bash(*)",
"Read",
"Edit",
"Write",
"Glob",
"Grep",
"WebSearch",
@itsdevdom
itsdevdom / statusline.js
Last active April 29, 2026 18:51
Claude Statusline
/*
* HOW TO USE
*
* Copy `statusline.js` (e.g. into your `.claude` folder), and remember its <ABSOLUTE PATH>.
* Then, add the following configuration to your `.claude/settings.json` file:
* ```json
* "statusLine": {
* "type": "command",
* "command": "node --no-warnings <ABSOLUTE_PATH>/statusline.js",
* "refreshInterval": 60000
@itsdevdom
itsdevdom / file-encoding-angular-umlaut.md
Last active March 26, 2026 11:35
file-encoding-angular-umlaut.md

While downloaded files (e.g. CSV) may look fine in a text editor (e.g. Windows Notepad), other programs (like Microsoft Excel) may not display Umlaute correctly.

To fix, first read the API response as pure binary aka arraybuffer (instead of blob directly). In Angular, that means setting your request options accordingly:

const requestOptions = {
  responseType: 'arraybuffer',
}
@itsdevdom
itsdevdom / unique-array.ts
Last active October 17, 2025 14:17
unique-array.ts
const array = [];
const uniqueArray = array.filter((value, index, values) => {
return values.indexOf(value) === index;
});
@itsdevdom
itsdevdom / group-by.ts
Created February 15, 2024 12:13
group-by.ts
/**
* Group array by item into object
*
* Polyfill for <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/groupBy>
* Inspired by <https://stackoverflow.com/questions/14446511/most-efficient-method-to-groupby-on-an-array-of-objects#answer-64489535>
*/
export const groupBy = <T>(array: Array<T>, predicate: (value: T, index: number, array: Array<T>) => string) =>
array.reduce(
(acc, value, index, array) => {
(acc[predicate(value, index, array)] ||= []).push(value);
@itsdevdom
itsdevdom / sort-to-top.ts
Created February 14, 2024 11:22
sort-to-top.ts
/**
* Sort one value to the top
*/
export const sortToTop = <T>(list: Array<T>, matchFn: (item: T) => boolean): Array<T> => {
return list.toSorted((listItemA, listItemB) => {
return matchFn(listItemA) ? -1 : matchFn(listItemB) ? 0 : 1;
});
};
@itsdevdom
itsdevdom / nuxt-icon-component.vue
Created January 29, 2024 14:17
Nuxt Icon Component
<script lang="ts" setup>
/**
* Icon Component
*
* Inspired by <https://github.com/gitFoxCode/nuxt-icons/blob/d7e4e5b0f59c923fe97c7b9eebd5b94be0650180/src/runtime/components/nuxt-icon.vue>
*/
// Props
const props = defineProps({
name: {
@itsdevdom
itsdevdom / virtualbox-ubuntu-setup.md
Created August 23, 2022 13:14
VirtualBox Ubuntu Setup
@itsdevdom
itsdevdom / jest-modulenamemappers.json
Created August 12, 2022 17:08
Jest modulenamemappers
{
"moduleNameMapper": {
"^d3-([a-z-]*)$": "d3-$1/dist/d3-$1",
"^lodash-es$": "lodash"
}
}
@itsdevdom
itsdevdom / delayAtLeast.ts
Created March 24, 2022 19:50
delayAtLeast RxJS Pipe
import { combineLatest, map, Observable, timer } from 'rxjs';
/**
* Delay at least (RxJS operator)
*
* @param delayInMs Delay in ms
*/
export const delayAtLeast = <T>(delayInMs: number) => {
return (observable: Observable<T>) => {
return combineLatest([timer(delayInMs), observable]).pipe(