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
| #!/bin/bash | |
| # 🚀 Run Only Changed Tests - Git Diff Integration Test Runner | |
| # | |
| # Stop running entire test suites! This script automatically detects and runs only | |
| # the integration tests that have changed in your git branch vs master. | |
| # | |
| # ⚡ SPEED UP YOUR WORKFLOW: | |
| # • Runs only modified .test.ts files in __integrations__/ | |
| # • Extracts specific test names from git diff (it/describe blocks) |
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 kc='kubectl' | |
| alias kclf='kubectl logs --tail=200 -f' | |
| alias kcgs='kubectl get service -o wide' | |
| alias kcgd='kubectl get deployment -o wide' | |
| alias kcgp='kubectl get pod -o wide' | |
| alias kcgn='kubectl get node -o wide' | |
| alias kcdp='kubectl describe pod' | |
| alias kcds='kubectl describe service' | |
| alias kcdd='kubectl describe deployment' | |
| alias kcdf='kubectl delete -f' |
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
| package merge | |
| // quick and dirty merge of two json raw messages | |
| // does not merge two json arrays | |
| // MergeJson merges two json raw messages. If key | |
| // exists in both maps, value from first argument will take precendence. | |
| func MergeJson(json1 *json.RawMessage, json2 *json.RawMessage) (*json.RawMessage, error) { | |
| map1 := map[string]interface{}{} | |
| map2 := map[string]interface{}{} |
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
| class Solution(object): | |
| def maxVowels(self, s, k): | |
| """ | |
| :type s: str | |
| :type k: int | |
| :rtype: int | |
| """ | |
| maxCount = 0 | |
| lastCount = -1 | |
| lastSubstrFirstLetterIsVowel = False |
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
| def isPrefixOfWord(sentence, searchWord): | |
| """ | |
| :type sentence: str | |
| :type searchWord: str | |
| :rtype: int | |
| """ | |
| words = sentence.split(" ") | |
| for i, word in enumerate(words): | |
| if word.startswith(searchWord): | |
| return i + 1 |
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
| class Solution(object): | |
| def peopleIndexes(self, favoriteCompanies): | |
| indices = [] | |
| favoriteCompanies = map(set, favoriteCompanies) | |
| for i, person in enumerate(favoriteCompanies): | |
| has_subset = False | |
| for j, otherPerson in enumerate(favoriteCompanies): | |
| if i == j: | |
| continue | |
| is_subset = True |
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
| class Solution(object): | |
| def arrangeWords(self, text): | |
| result = " ".join(sorted(text.lower().split(),key = lambda w: len(w))) | |
| return result[:1].upper() + result[1:] |
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
| io = [ | |
| [ | |
| [[[-2,0],[2,0],[0,2],[0,-2]], 2], #input | |
| 4 #output | |
| ], | |
| [ | |
| [[[-3, 0], [3, 0], [2, 6], [5, 4], [0, 9], [7, 8]], 5], | |
| 5 | |
| ] | |
| ] |
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
| class Solution(object): | |
| def busyStudent(self, startTime, endTime, queryTime): | |
| return len(filter(lambda se: queryTime >= se[0] and queryTime <= se[1], zip(startTime, endTime))) |
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
| ls > list.txt.temp ; awk {'printf ("%s\t\n", $0) > "list.tsv";'} list.txt.temp; rm list.txt.temp |
NewerOlder