Skip to content

Instantly share code, notes, and snippets.

View ddfreiling's full-sized avatar

Daniel Freiling ddfreiling

View GitHub Profile
@xykong
xykong / k8sdump.sh
Last active January 14, 2024 15:19
Export Kubernetes cluster resource to yaml.
#!/usr/bin/env bash
readonly SCRIPT=$(basename "$0")
readonly VERSION='1.0.0'
readonly AUTHOR='xy.kong@gmail.com'
readonly SOURCE='https://gist.github.com/xykong/6efdb1ed57535d18cb63aa8e20da3f4b'
# For script running robust
set -o nounset # to exit when your script tries to use undeclared variables
set -o errexit # to make your script exit when a command fails
@janeczku
janeczku / rancher-argocd.md
Created June 10, 2020 14:10
How to register Rancher managed Kubernetes clusters in Argo CD

How to register Rancher managed Kubernetes clusters in Argo CD

Registering Rancher managed clusters in Argo CD doesn't work out of the box unless the Authorized Cluster Endpoint is used. Many users will prefer an integration of Argo CD via the central Rancher authentication proxy (which shares the network endpoint of the Rancher API/GUI). So let's find out why registering clusters via Rancher auth proxy fails and how to make it work.

Hint: If you are just looking for the solution scroll to the bottom of this page.

Why do i get an error when running argocd cluster add?

Service Account tokens and the Rancher authentication proxy

@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active April 23, 2024 12:18
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
@NachoSoto
NachoSoto / UIAccessibilityTraits+Extensions.swift
Last active March 19, 2019 23:10
Extensions to simplify usage of accessibilityTraits in Swift 4.2:
// Extensions to simplify usage of accessibilityTraits in Swift 4.2:
public func |= (traits: inout UIAccessibilityTraits, other: [UIAccessibilityTraits]) {
for o in other {
traits |= o
}
}
public func |= (traits: inout UIAccessibilityTraits, other: UIAccessibilityTraits) {
// From: https://swift.org/migration-guide-swift4.2/#known-migration-issues
@EddyVerbruggen
EddyVerbruggen / nativescript-radlistview-activityindicators-appearance.ts
Last active October 21, 2018 17:04
Change appearance of Activity Indicators in NativeScript RadListView
export class ComponentWithRadListView {
// assuming you have something like this in your view:
// <RadListView (loaded)="onOrderListLoaded($event)">
onOrderListLoaded(args): void {
const listViewElement = <RadListView>args.object;
const tk: any = listViewElement.ios;
if (tk && tk.pullToRefreshView) {
tk.pullToRefreshView.activityIndicator.color = new Color("#4CC55B").ios;

One of the main goals of tns-core-modules@4.0 is to enable more flexible composition of UI. Let's start with some history. Before 4.0 we create Frame control for you (check application.ios.ts and frame.android.ts). Frame control allows you to do navigation forward or backward. While this is convenient it introduce other issues that can't be workaround easliy. For example if you want to have TabView in all pages you have to include it in the xml and set its selectedIndex so that once you navigate to different page a correct TabViewItem is selected. This leads to several problems:

  • parse more xml
  • increase memory usage
  • increase loading time

Same issues apply if you want to have SideDrawer control as a root component.

So in order to resolve these starting with 4.0 applicat

@nic0lette
nic0lette / AudioFocusAwarePlayer.java
Last active November 15, 2022 09:39
A couple of classes (and an interface!) to make it easier to adapt to the audio focus changes that were introduced in Android Oreo.
/*
* Copyright 2017 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Pulimet
Pulimet / AdbCommands
Last active May 22, 2024 09:34
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@Jpoliachik
Jpoliachik / RCTAccessibilityManager+FontMultipliers.m
Last active August 28, 2018 13:20
React Native iOS Accessibility Font Scaling Workaround
//
// RCTAccessibilityManager+FontMultipliers.m
//
// This category is a workaround React Native's default Font Sizing Accessibility settings
//
// Swizzle the getter of the font size multipliers so we can limit the max size.
//
#import "RCTAccessibilityManager+FontMultipliers.h"
#import <objc/runtime.h>
@BoD
BoD / .travis.yml
Last active October 27, 2020 13:25
Travis build file for Android: the whole file
language: java
dist: trusty
jdk: oraclejdk8
before_cache:
# Do not cache a few Gradle files/directories (see https://docs.travis-ci.com/user/languages/java/#Caching)
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache: