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/python | |
import sys, subprocess | |
def main(argv=None): | |
try: | |
query = [item.replace('REG_SZ', '').strip() for item in subprocess.check_output("reg query HKCR /v VSCode.* /s").splitlines() if len(item) > 0][0: -1] | |
queryItems = [(query[i],query[i+1]) for i in range(0, len(query), 2)] | |
for item in queryItems: | |
print("Deleting {0} from {1}".format(item[0], item[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
public class Solution { | |
public static void main(String[] args) { | |
String[] input = { "5", "4+20*3", "20*3+4", "20+20+20+4", "4*4*4" }; | |
for (String test : input) | |
System.out.printf("%s = %d%n", test, eval(test)); | |
} | |
private static int eval(String input) { | |
int sum = 0; |
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
public class Program { | |
internal class Node<T> { | |
final T data; | |
final Node<T> left; | |
final Node<T> right; | |
bool hasLeftChild() { | |
return this.left != null; | |
} |
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 ".\packages\*" -Include "build", "coverage", "dist", "node_modules" -Depth 2 | select FullName | % { rm -Recurse -Force -Verbose $_.FullName } |
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
const letters = 'abcdefghijklmnopqrstuvwxyz'; | |
const numbers = '1234567890'; | |
const charset = letters + letters.toUpperCase() + numbers; | |
function pickRandomElement(array) { | |
const { floor, random } = Math; | |
return array[floor(random() * array.length)]; | |
} | |
function randomString(length) { |
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 Spinner { | |
static #count = 0; | |
static #svgWrapperTemplate({ className, id, children }) { | |
return ` | |
<svg id="${id}" class="${className}" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"> | |
${children} | |
</svg> | |
`; | |
} |
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 | |
SELF_SIGNED_CERTS_DIR="$PWD/.ssl" | |
[[ ! -d $SELF_SIGNED_CERTS_DIR ]] && mkdir $SELF_SIGNED_CERTS_DIR | |
rm -rf $SELF_SIGNED_CERTS_DIR/* | |
openssl req -newkey rsa:2048 -new -nodes \ | |
-keyout $SELF_SIGNED_CERTS_DIR/private-key.pem \ | |
-out $SELF_SIGNED_CERTS_DIR/csr.pem | |
openssl x509 -req -days 365 \ | |
-in $SELF_SIGNED_CERTS_DIR/csr.pem \ |
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
interface MainFuncAsync { | |
(args: string[]): Promise<number|void> | |
} | |
class ProgramEntryPoint { | |
static main: MainFuncAsync; | |
} | |
interface IProgramEntryPoint { | |
new(): ProgramEntryPoint |
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
#To Decrypt Jenkins Password from credentials.xml | |
#<username>jenkins</username> | |
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase> | |
#go to the jenkins url | |
http://jenkins-host/script | |
#In the console paste the script | |
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J' |
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 | |
# Instructions: | |
# Place this file inside /etc/NetworkManager/dispatcher.d/ | |
# sudo chown root:root 00_toggle-repo.sh | |
# sudo chmod +x 00_toggle-repo.sh | |
repos="rhel8-csb" |
OlderNewer