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
// This file was initially generated by Windows Terminal 1.4.3243.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
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 | |
set -euxo pipefail | |
EG_ID=$1 | |
KEY="key1" | |
endpoint=$(az eventgrid topic show --ids $EG_ID --query endpoint | sed -e 's/^"//' -e 's/"$//') | |
eg_name=$(az eventgrid topic show --ids $EG_ID --query name | sed -e 's/^"//' -e 's/"$//') | |
eg_group=$(az eventgrid topic show --ids $EG_ID --query resourceGroup | sed -e 's/^"//' -e 's/"$//') |
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
let uniqueId = Date.now().toString(36) + Math.random().toString(36).substring(2); | |
const guid=()=> { | |
const s4=()=> Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); | |
return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4() + s4() + s4()}`; | |
} | |
function generateGuid() { | |
var result, i, j; |
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
var crypto = require('crypto') | |
, fs = require('fs') | |
// Algorithm depends on availability of OpenSSL on platform | |
// Another algorithms: 'sha1', 'md5', 'sha256', 'sha512' ... | |
var algorithm = 'sha1' | |
, shasum = crypto.createHash(algorithm) | |
// Updating shasum with file content | |
var filename = __dirname + "/anything.txt" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
HOME="http://www.yourdomain.com/some/page" | |
DOMAINS="yourdomain.com" | |
DEPTH=2 | |
OUTPUT="./urls.csv" | |
wget -r --spider --delete-after --force-html -D "$DOMAINS" -l $DEPTH "$HOME" 2>&1 \ | |
| grep '^--' | awk '{ print $3 }' | grep -v '\. \(css\|js\|png\|gif\|jpg\)$' | sort | uniq > $OUTPUT |
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
ssh-keygen -y -f private_key1.pem > public_key1.pub |
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 keras.applications.vgg16 import VGG16 | |
from keras.applications.vgg16 import preprocess_input | |
import keras.backend as K | |
import numpy as np | |
import json | |
import shap | |
# load pre-trained model and choose two images to explain | |
model = VGG16(weights='imagenet', include_top=True) | |
X,y = shap.datasets.imagenet50() |
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 | |
filename='reqs.txt' | |
echo Start | |
while read p; do | |
title=$(echo "$p" | cut -d, -f1) | |
body=$(echo "$p" | cut -d, -f2) | |
gh issue create --title "$title" --body "$body" --label "enhancement" | |
done < $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
public static void progressPercentage(int remain, int total) { | |
if (remain > total) { | |
throw new IllegalArgumentException(); | |
} | |
int maxBareSize = 10; // 10unit for 100% | |
int remainProcent = ((100 * remain) / total) / maxBareSize; | |
char defaultChar = '-'; | |
String icon = "*"; | |
String bare = new String(new char[maxBareSize]).replace('\0', defaultChar) + "]"; | |
StringBuilder bareDone = new StringBuilder(); |