Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
sandipchitale / rewritehistory-main.sh
Last active October 1, 2023 22:25
Collapse all history of git repo. #git
git checkout --orphan onetime
git add -A
git commit -m "Initial commit"
git branch -D main
git branch -m main
git gc --aggressive --prune=all
git push -f origin main
@andreroggeri
andreroggeri / angular-stability-check.js
Last active October 21, 2021 07:23
Checks the Angular stability and logs on the console. Useful for debugging long protractor waits
/**
* Copy and paste the code below on your browser console
* It will log the stable changes and how long it took to become stable
*/
let currentStatus = undefined;
let root = $('app-root'); // Change this selector to the component that you'll be watching (Usually the root component)
let startTime = new Date();
let stabilityChecker = setInterval(() => {
let newStatus = window.getAngularTestability(root).isStable();
if (currentStatus !== newStatus) {
@bjankord
bjankord / index.js
Created January 14, 2019 18:34
axe-core + puppeteer set up
const util = require('util');
const puppeteer = require('puppeteer');
const axe = require('axe-core');
const urls = [
'https://engineering.cerner.com/terra-ui/#/home/terra-ui/index',
'https://engineering.cerner.com/terra-ui/#/getting-started/terra-ui/what-is-terra',
];
const results = [];
@sandipchitale
sandipchitale / JDKSLLTLS
Created November 4, 2019 06:17
Docs for JDK SSL/TLS
https://docs.oracle.com/javase/10/security/java-secure-socket-extension-jsse-reference-guide.htm#JSSEC-GUID-93DEEE16-0B70-40E5-BBE7-55C3FD432345
@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active June 12, 2024 18:01
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@diafour
diafour / cluster-19.sh
Last active June 5, 2024 11:31
Run kind cluster with access to local registry
#!/usr/bin/env bash
# A helper for kind to create and delete clusters with untrusted local registry.
# Based on https://kind.sigs.k8s.io/docs/user/local-registry/
#
# Note: kind 0.10.0
# Settings for kind cluster
CLUSTER_NAME="kube-19"
KIND_NODE_IMAGE="kindest/node:v1.19.7"
@elliottsj
elliottsj / cucumber.impl.js
Created January 17, 2020 17:14
Cucumber Nx builder example
const {
createBuilder,
targetFromTargetString,
scheduleTargetAndForget,
} = require('@angular-devkit/architect');
const { readWorkspaceJson } = require('@yolkai/nx-workspace');
const execa = require('execa');
const path = require('path');
const { Observable, from, of } = require('rxjs');
const { catchError, map, mergeMap } = require('rxjs/operators');
@sandipchitale
sandipchitale / aexpath.js
Last active June 14, 2020 09:04
Get xPath of document.activeElement
{ let e = document.activeElement; let pchain = []; while (e.tagName !== 'BODY') { pchain.unshift(e.tagName + '[' + (Array.prototype.indexOf.call(e.parentElement.querySelectorAll(':scope > ' + e.tagName), e) + 1) + ']'); e = e.parentElement; } ; '/html/body/' + pchain.join('/').toLowerCase() }
@sandipchitale
sandipchitale / pom.xml
Last active November 6, 2020 03:09
Generic mechanism to install self to local repository in m2 folder
<!--
To use this goal invoke it like this:
> mvnw install:install-file@m2
This will install the artifact in local folder m2/repository
-->
<build>
<plugins>
<plugin>
@sandipchitale
sandipchitale / apply-gradle-taskinfo.gradle
Created November 15, 2020 00:48
Apply gradle-taskinfo plugin to rootProject
initscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.org.barfuin.gradle.taskinfo:gradle-taskinfo:1.0.3"
}
}