Skip to content

Instantly share code, notes, and snippets.

@avielb
avielb / lesson_1.py
Last active November 24, 2019 19:46
# print
print("Hello world!")
# if statement
x = 1
if x == 1:
print("x is 1")
my_integer = 7
print(my_integer)
https://gist.github.com/avielb/98393e1fa37c6a66be1df34be68087d3
# Conditionals
isTrue = False
a = 2
b = 2.5
strOne = "One"
strThree = "Three"
if a < b:
@avielb
avielb / fibo.py
Last active January 6, 2023 09:59
def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < n:
print(b)
a, b = b, a+b
def fib2(n): # return Fibonacci series up to n
result = []
a, b = 0, 1
while b < n:
from datetime import datetime
from time import sleep
sleep(10)
print(datetime.now())
#read_my_contents.txt
'''
this file has contents
and rows
and characters than can be
@avielb
avielb / lesson_4.py
Last active November 4, 2019 16:16
from selenium import webdriver
from time import sleep
driver = webdriver.Chrome(executable_path="c:/chromedriver.exe")
driver.get("https://www.google.com")
for i in range(20):
driver.refresh()
sleep(2)
driver.close()
from selenium import webdriver
from os import system, name
def screen_cleaner():
if name == 'nt':
system("cls")
else:
pass
system("clear")
node("slave01") {
stage("build"){
sh "date"
//bat "time /T"
}
}
node("slave01") {
stage("build"){
echo "Building Application"
# git download
# https://linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/
# git config
git config --global user.name "avielb"
git config --global user.email "aviel33@gmail.com"
# from git bash
mkdir my-first-project
cd my-first-project
pipeline {
agent any
stages {
stage("checkout"){
steps{
git "https://github.com/avielb/work-with-github.git"
}
}
stage("run something"){
steps{
properties([parameters([string(defaultValue: 'default value', description: '', name: 'VAR1', trim: false)]),
pipelineTriggers([pollSCM('*/2 * * * *')])])
pipeline {
agent any
stages {
stage("checkout"){
steps{
git "https://github.com/avielb/work-with-github.git"
}
}