This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM_TEXT=CX-133209 | |
| TO_TEXT=CX-136414 | |
| FEAT_BRANCH_NAME=cx-136414 | |
| BASE_BRANCH_NAME=master | |
| "C:/Program Files/Python312/python.exe" git-filter-repo.py --commit-callback ' | |
| msg = commit.message.decode("utf-8") | |
| newmsg = msg.replace("${FROM_TEXT}", "${TO_TEXT}") | |
| commit.message = newmsg.encode("utf-8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Playground here: https://codepen.io/tw3/pen/eYaMPOZ | |
| function parseCsp(csp) { | |
| const result = []; | |
| const cspArr = csp.split(';'); | |
| cspArr.forEach((x) => { | |
| const vals = x.trim().split(' ').filter(Boolean); | |
| let idx = 0; | |
| const entryArr = []; | |
| entryArr.push(vals[idx++]); // resource, e.g. default-src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Directive, HostListener } from '@angular/core'; | |
| import { NgControl } from '@angular/forms'; | |
| // Trims text for an Angular form control as the text is input, e.g. " foobar " -> "foobar" | |
| @Directive({ | |
| selector: '[trimOnInput]', | |
| standalone: true, | |
| }) | |
| export class TrimOnInputDirective { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class RotatingIterator<T> implements Iterable<T> { | |
| private readonly origStart: number; | |
| private nextIndex: number; | |
| private isDone: boolean; | |
| private hasLooped: boolean; | |
| constructor(private readonly arr: T[], private startIndex = 0) { | |
| this.origStart = startIndex; | |
| this.nextIndex = startIndex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable, BehaviorSubject, Subject } from 'rxjs'; | |
| export enum StoreState { | |
| INIT, | |
| LOADING, | |
| READY | |
| } | |
| interface StoreInterface<T> { | |
| value$: Observable<T>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // <project_root>/e2e/protractorDownloads/protractor-download-helper.ts | |
| import { browser } from 'protractor'; | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| export class ProtractorDownloadHelper { | |
| private readonly maxReadWaitTime = 10000; // 10 seconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias gdbak='GDBAK_FILENAME="../../temp/diff-bak-$(date +%s%3N)_$(git branch --show-current).tar"; tar cvf "${GDBAK_FILENAME}" `git diff --name-only`; echo "${GDBAK_FILENAME}"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| TARGET_BRANCH=$(git branch --show-current) | |
| if [ -z "${TARGET_BRANCH}" ]; then | |
| echo "Please cd into to the target branch" | |
| exit; | |
| fi | |
| echo "Cherry-picking to branch: ${TARGET_BRANCH}" | |
| read -p "Cherry-picking from branch: " SOURCE_BRANCH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| main() { | |
| echo "Here's an example:" | |
| echo "" | |
| echo "\"C:/Program Files/Python39/python.exe\" c:/bin/git-filter-repo.py --commit-callback '" | |
| echo "msg = commit.message.decode(\"utf-8\")" | |
| echo "newmsg = msg.replace(\"TEXT_FROM\", \"TEXT_TO\")" | |
| echo "commit.message = newmsg.encode(\"utf-8\")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Example: | |
| * | |
| * const builder = new XPathBuilder(); | |
| * const xpathStr = builder | |
| * .addDescendant({ nodeName: 'carbon-dropdown' }) | |
| * .addDescendant({ className: 'bx--label', innerText: 'AWS Region' }) | |
| * .addAncestor({ nodeName: 'carbon-dropdown' }) | |
| * .build(); | |
| * |
NewerOlder