Skip to content

Instantly share code, notes, and snippets.

Avatar
🌼

Cedric Kring cedrickring

🌼
View GitHub Profile
View kaniko-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: kaniko
spec:
initContainers:
- name: kaniko-init
image: alpine
args:
- "sh"
@cedrickring
cedrickring / README.md
Last active Dec 20, 2018
Use zsh instead of bash in WSL
View README.md

Use zsh instead of bash in WSL

Prerequisites

First of all, you need to install your favorite Windows Subsystem for Linux flavor.
For installation steps, see here

Install zsh

To install zsh, you should follow the steps described here.
I'd recommend installing Oh My Zsh too, since it's a great extension for zsh.

@cedrickring
cedrickring / unsubscribe-decorator.ts
Last active Feb 5, 2019
Add this to decorator to your RxJS Subscription's to unsubscribe them when ngOnDestroy is called
View unsubscribe-decorator.ts
import { Subscription } from 'rxjs';
/**
* Example:
*
* ```
* @Unsubscribe()
* public subscription: Subscription
* ```
*
View .vimrc
"curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
"Plugins"
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'itchyny/lightline.vim'
call plug#end()
@cedrickring
cedrickring / mergeObjects.js
Created Sep 19, 2020
Deep merge two objects in javascript
View mergeObjects.js
function mergeObjects(target, source, mergeArrayWith) {
if (!mergeArrayWith) {
mergeArrayWith = (targetArray, sourceArray) => [...targetArray, ...sourceArray];
}
Object.keys(source).forEach(key => {
const existingValue = target[key];
const valueToBeMerged = source[key];
if (Array.isArray(existingValue)) {
@cedrickring
cedrickring / ColoredShadow.kt
Created Nov 1, 2020
Draw a colored shadow in Android Jetpack Compose
View ColoredShadow.kt
import androidx.compose.ui.Modifier
import androidx.compose.ui.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
fun Modifier.drawColoredShadow(
color: Color,