This file contains 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
is_palindrome = lambda word:word.upper() == word[::-1].upper() | |
print(is_palindrome('Deleveled')) |
This file contains 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
#print moves | |
def move(disc,origin,destination): | |
print('Disc',disc,'from tower',origin,'to tower',destination) | |
count = 1 | |
def hanoi(n,fr,to,temp): | |
'''print moves on hanoi tower puzzle | |
Args: | |
n(int):number of discs | |
fr(string):origin tower |
This file contains 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
TOKEN=<github_token> | |
USERNAME=<github_user> | |
FILENAME=automate_git.sh | |
echo "What name do you want to give your remote repo? " | |
read REPO_NAME | |
echo "Enter a repo description. Do NOT use spaces: " | |
read DESCRIPTION |
This file contains 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
#code $PROFILE (or another editor) | |
#add these changes | |
function Up-DockerCompose() { | |
docker-compose up | |
} | |
function Up-DockerComposeD() { | |
docker-compose up -d | |
} |
This file contains 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 fizz_buzz(n: int = 15) -> list[str]: | |
fizz = lambda x: x % 3 == 0 | |
buzz = lambda x: x % 5 == 0 | |
result = [] | |
for i in range(1, n + 1): | |
if fizz(i) and buzz(i): | |
result.append("fizz_buzz") | |
continue | |
if buzz(i): | |
result.append("buzz") |
This file contains 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
async function sendPostRequestToURL(bodyData, url) { | |
let submission = await fetch(url, { | |
method: 'post', | |
headers: { | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify(bodyData) | |
}); | |
return submission.status; | |
} |
This file contains 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
async function getData(){ | |
let url = 'https://jsonplaceholder.typicode.com/posts/1'; | |
let page = await fetch(url); | |
let json = await page.json(); | |
console.log(json); | |
} | |
async function postData(){ | |
let url = 'https://jsonplaceholder.typicode.com/posts'; |
This file contains 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 gtts import gTTS | |
import os | |
from playsound import playsound | |
import sys | |
text = "Flow has been completed" | |
lang = "en" | |
tld = "ca" | |
audio_filename = r"C:\Users\lcosta\PowerAutomate\sample.mp3" |
This file contains 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
$number = 100 | |
$path = "<where the key will be stored>" | |
$keyname = Read-Host "Please enter your keyname" | |
$comment = $keyname | |
ssh-keygen -a $number -t ed25519 -f $path$keyname -C $comment | |
ssh-add $path$keyname |
This file contains 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
eval "$(ssh-agent -s)" | |
number=100 | |
path=$HOME/.ssh/ | |
read -p 'Keyname: ' keyname | |
comment=$keyname | |
ssh-keygen -a $number -t ed25519 -f $path$keyname -C $comment | |
ssh-add $path$keyname |
OlderNewer