Skip to content

Instantly share code, notes, and snippets.

View fkirc's full-sized avatar

fk fkirc

  • Austria
View GitHub Profile
@fkirc
fkirc / ci.yml
Last active October 2, 2020 12:51
Capacitor Cross-platform GitHub Action: npm + Android
name: CI
on:
push:
workflow_dispatch:
jobs:
pre_job:
runs-on: ubuntu-latest
# Map a step output to a job output
@fkirc
fkirc / ci.yml
Last active June 27, 2022 10:26
npm GitHub Action - Test automatically. Trigger releases manually.
name: CI
on:
push:
branches:
- '**'
workflow_dispatch:
inputs:
release:
description: 'Release'
@fkirc
fkirc / .eslintrc.js
Last active September 17, 2020 11:22
ESLint React configuration (combined with Prettier + WebStorm)
module.exports = {
extends: [
"react-app",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"prettier/react",
],
plugins: [
"simple-import-sort"
{
"compilerOptions": {
"target": "es2018",
"lib": [
"es6",
"dom",
"dom.iterable",
"esnext",
"es2018"
],
@fkirc
fkirc / NonFatalAbortTree.kt
Created March 26, 2020 22:32
Make Android UI tests fail if an error gets logged to Timber
import android.util.Log
import androidx.test.espresso.Espresso
import org.junit.Assert
import timber.log.Timber
/**
* During UI tests, we want to fail the test immediately if any "non-fatal error" happens.
* The purpose of non-fatal errors is to inform as about production failures without crashing the entire app.
*/
object NonFatalAbortTree: Timber.Tree() {
@fkirc
fkirc / checkout_all.py
Created January 16, 2020 21:09
Small Python template for shell operations
import os
import subprocess
def sh(cmd):
print('sh: ' + cmd)
ret = subprocess.run(cmd, shell=True, env=os.environ, executable='/bin/bash')
if ret.returncode != 0:
exit(ret.returncode)
@fkirc
fkirc / gitsetup.sh
Last active October 14, 2022 10:24
My global git configuration
#!/bin/bash
set -e
set -x
# It would be painful to repeat credentials every time.
# This should store them to ~/.git-credentials
git config --global credential.helper store
# Default merge
git config --global pull.rebase false
@fkirc
fkirc / JAVA_HOME locations
Last active December 19, 2019 12:50
JAVA_HOME locations
macOS Android Studio JDK:
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
#!/usr/bin/python
import sys
def read_file(f):
print(f.read())
def main():
@fkirc
fkirc / unzip_aar.sh
Created September 23, 2019 15:29
Unzip an Android Archive (AAR)
#!/usr/bin/env bash
set -xe # Log everything, abort if anything fails
# Simple script to unzip Android Archive libraries (AAR files)
usage() {
echo "Usage: $0 <aar file>"
exit 1
}