Skip to content

Instantly share code, notes, and snippets.

Album Track Number Track Artist
Mr Music Dansband 1 91 1 Åren Som Gått Lasse Stefanz
Mr Music Dansband 1 91 2 Varje Steg Berth Idoffs
Mr Music Dansband 1 91 3 Låt Det Bästa Stanna Kvar Stefan Borsch
Mr Music Dansband 1 91 4 Opus One Denis King
Mr Music Dansband 1 91 5 The Wonder Of You Ingmar Nordströms
Mr Music Dansband 1 91 6 Sista Kvällen Thorleifs
Mr Music Dansband 1 91 7 De Tusen Sjöars Land Tommys
Mr Music Dansband 1 91 8 Inget Kan Stoppa Oss Nu BlackJack
Mr Music Dansband 1 91 9 Lyckoslanten Stefan Borsch
@tkhduracell
tkhduracell / setup.sh
Last active February 24, 2023 16:15
Setup GitHub Actions with Google Cloud Workload Identity Provider
#!/bin/bash
# Update with your values:
# export GCLOUD_PROJECT="my-project"
# export GITHUB_REPO=github-user/my-repo
#
GCLOUD_SERVICE_ACCOUNT=github-deployer-account
GCLOUD_SERVICE_ACCOUNT_EMAIL="${GCLOUD_SERVICE_ACCOUNT}@${GCLOUD_PROJECT}.iam.gserviceaccount.com"
@tkhduracell
tkhduracell / container-health-check.sh
Last active October 29, 2022 11:59
Await container start healthy (smoke test)
#!/bin/sh
set -e pipefail
#
# Assuming container has HEALTHCHECK command specified.
# Example:
# HEALTHCHECK --interval=1s --timeout=1s --start-period=3s --retries=30 \
# CMD curl --fail http://localhost:80/ || exit 1
#
@tkhduracell
tkhduracell / filter.array.ts
Last active September 29, 2020 08:04
Typescript: Filter array/list of objects based on attributes filter
/**
* Filters an array of objects (one level-depth) with multiple criteria.
*/
export function filterArray<T extends Record<string, string | number | undefined>>(array: T[], filters: Partial<T>): T[] {
const filterKeys = Object.entries(filters);
return array.filter(item => {
return filterKeys.every(([filterKey, filterValue]) => {
return filterKey in item && item[filterKey] === filterValue
});
});
@tkhduracell
tkhduracell / test.spec.ts
Last active September 29, 2020 07:40
Typescript: Testing class with jest mock and typescript-ioc container save/restore
import { Container, Snapshot } from 'typescript-ioc'
import { MyController } from '../../src/controllers/my'
import { MyService } from '../../src/services/my'
describe('MyController()', () => {
let snapshot!: Snapshot;
beforeEach(function () {
@tkhduracell
tkhduracell / versions.js
Created January 14, 2019 19:21
Parse Google Play Store version information, node.js, cheerio, scrape
const extractContent = module.exports.extractContent = $ => {
return {
lines: $("div:contains('What's New') > h2")
.parent()
.parent()
.find('content')
.get()
.map(block => block.children.map(node => {
return $(node).text() // Using dot list in release notes
@tkhduracell
tkhduracell / panda.py
Created September 25, 2018 14:05
Space separate thousands in Pandas Dataframe
import pandas as pd
pd.set_option('display.float_format', lambda x: "{:0,.0f}".format(x).replace(',', ' '))
@tkhduracell
tkhduracell / _.md
Created September 18, 2018 05:39
error: package com.google.auto.value does not exist android

I added the following dependencies to get auto-value 1.6.2 to work on android.

implementation      "com.google.auto.value:auto-value-annotations:1.6.2"
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
compileOnly 'com.google.auto.value:auto-value:1.6.2'
static void main(char*[] args) {
int[] numbers = {11,12,13, 21,22,23, 31,32,33};
int intervalMin = 10;
int intervalMax = 20;
cout << "10-20: Average is " << getAverage(numbers, 10, 20) << endl;
}
@tkhduracell
tkhduracell / SLOW_NETWORKING.md
Last active September 29, 2020 07:39
Android Dev: Set up really reeeeally low network on your emulator

Open terminal

telnet localhost 5554

As described read the ‘$HOME/.emulator_console_auth_token' file to get the token.

Use auth command to log in

  auth 7kTWr7__________