Skip to content

Instantly share code, notes, and snippets.

apiVersion: v1
kind: Service
metadata:
name: superset
spec:
selector:
name: superset
type: NodePort
ports:
- port: 8080
https://bit.ly/2zurczJ
0==false // true, because false is equivalent of 0
0===false // false, because both operands are of different type
2=="2" // true, auto type coercion, string converted into number
2==="2" // false, since both operands are not of same type
http://www.seleniumhq.org/download/
node{
stage("a"){
parallel(
one: {
echo "This is branch 1"
sh "sleep 10"
},
two: {
echo "This is branch 2"
sh "sleep 2"
import requests
# get result from currencyconverterapi
myrequest = requests.get("https://free.currencyconverterapi.com/api/v6/convert?q=USD_ILS&compact=n&apiKey=72a1f59a5bf27c222c80")
# save result as json
result = myrequest.json()
# print ILS to USD currency
print(result['results']['USD_ILS']['val'])
def welcome(name):
print("Hello", name, "and welcome to the World Of Games(WoG). \nHere you can find many cool games to play.")
welcome("Mai")
def load_game():
print("""Please choose a game to play:
\t1. Memory Game - a sequence of numbers will appear for 1 second and you have to guess it back
\t2. Guess Game - guess a number and see if you chose like the computer
\t3. Weather Roulette - Guess the current temperature currently in Jerusalem""")
while True:
dict_to_test = {"name":"aviel", "age": 29, "hobbies": [1,2,3]}
dict_schema = {"name": type(""), "age": type(1), "hobbies": type([]), "nicknames:": type([])}
"""
function name: validator
input:
git clone https://github.com/avielb/ansible-demo.git
ssh-copy-id root@localhost -p 32769
ssh-copy-id root@localhost -p 32768
# password is screeencast
# https://galaxy.ansible.com/
import logging
logging.basicConfig(filename='app.log', filemode='a', format='%(name)s - %(levelname)s - %(message)s', level=logging.INFO)
logging.warning('This will get logged to a file')
logging.info('This will get logged to a file')
def print_x(length):
i = 0
j = length
for row in range(length + 1):
for col in range(length + 1):
if row == i and col == j:
print("#",end="")
i = i + 1
j = j -1
elif row == col:
@avielb
avielb / class_2_home_work.py
Created July 18, 2019 16:56 — forked from khjomaa/class_2_home_work.py
class_2_questions_soultion
#!/usr/bin/env python
__author__ = 'khalilj'
__creation_date__ = '03/25/2019'
# A
x = 10
y = 20