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
class Dog: | |
def __init__(self, species): | |
self.species = species | |
def description(self): | |
print("A dog always barks") | |
def speak(self): | |
print("Whoof! Whoof!") |
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 selenium import webdriver | |
from time import sleep | |
def tip_calculator(): | |
mywebdriver = webdriver.Chrome(executable_path="/Users/avielb/Downloads/chromedriver") | |
mywebdriver.get("file:///Users/avielb/Downloads/tip_calc%203/index.html") | |
amount = mywebdriver.find_element_by_id("billamt") | |
amount.send_keys("20") |
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 selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from time import sleep | |
def linked_in(): | |
driver = webdriver.Chrome(executable_path="/Users/avielb/Downloads/chromedriver") | |
driver.get("https://google.com") | |
sleep(3) | |
driver.find_element_by_name("q").send_keys("aviel buskila linkedin") | |
driver.find_element_by_name("btnK").submit() |
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
node("slave001") { | |
stage("build") { | |
bat "python C:/Users/<username>/PycharmProjects/first/venv/SixClass/${PROGRAM_NAME}.py" | |
} | |
} |
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
import time | |
import redis | |
from flask import Flask | |
app = Flask(__name__) | |
cache = redis.Redis(host='redis', port=6379) | |
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
version: '3' | |
services: | |
web: | |
build: . | |
ports: | |
- "5000:5000" | |
redis: | |
image: "redis:alpine" |
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
node { | |
stage("My Stage") { | |
echo "Checkout repository" | |
checkout([$class: 'GitSCM', branches: [[name: '*/feature/*']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'http://github.com/avielb/my-cool-app.git']]]) | |
} | |
} |
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 python:3.4-alpine | |
ADD . /code | |
WORKDIR /code | |
RUN pip install -r requirements.txt | |
CMD ["python", "app.py"] |
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
# get all running instances | |
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" | |
# get all running instance ids | |
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" --query 'Reservations[].Instances[].InstanceId' | |
# stop all t2.micro instancea | |
aws ec2 stop-instances --instance-ids `aws ec2 describe-instances --filters "Name=instance-type,Values=t2.micro" --query "Reservations[].Instances[].InstanceId" --output text` |
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 os import system, name | |
def screen_cleaner(): | |
if name == 'nt': | |
system("cls") | |
else: | |
pass | |
system("clear") |
OlderNewer