Skip to content

Instantly share code, notes, and snippets.

View borislavstoychev's full-sized avatar
💭
💻 Coding....

Borislav Stoychev borislavstoychev

💭
💻 Coding....
View GitHub Profile
from project.animals.birds import Owl, Hen
from project.food import Meat, Vegetable, Fruit
from project.animals.mammals import Tiger
if __name__ == "__main__":
owl = Owl("Pip", 10, 10)
print(owl)
meat = Meat(4)
print(owl.make_sound())
function passValidator(pass) {
let errors = []
function len(pass) {
if (!(pass.length >= 6 && pass.length <= 10))
errors.push("Password must be between 6 and 10 characters")
return pass
}
function checkConsists(pass) {
for (let i = 0; i < pass.length; i++) {
function foo(num) {
let evenSum = 0;
let oddSum = 0;
for (const n of String(num)) {
Number(n) % 2 == 0 ? evenSum += Number(n) : oddSum += Number(n)
}
return ` Odd sum = ${oddSum}, Even sum = ${evenSum}`;
}
console.log(foo(1000435))
let evenSum = 0;
let oddSum = 0;
for (const n of String(num)) {
Number(n) % 2 == 0 ? evenSum += Number(n) : oddSum += Number(n)
}
return ` Odd sum = ${oddSum}, Even sum = ${evenSum}`;
function solve(speed, area) {
speed = Number(speed);
let status;
const areaLimits = {
motorway: 130,
interstate: 90,
city: 50,
residential: 20,
};

./chia_plot -r 16 -t /mnt/ssd -d /mnt/hdd1/madmax/ -n 10 -c xch1tet0pz5rwdwextpvg7esrw9c9v8a99z66jp99zkuvqxg9mz7kp3s9nzmwc -f 81dfda42469c891d7d9bc0f7d9a4d814baec6d7f47a3515e4436c1eccb850a770e673cb2fa85434992fea36efe34ab80

function arrManipulations(args) {
let myArr = args
.shift()
.split(" ")
.map(Number)
for (commands of args) {
let [command, firstN, secondN] = commands.split(" ");
firstN = Number(firstN)
secondN = Number(secondN)
switch (command) {
# Use antigen
source $HOME/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
antigen bundle heroku
antigen bundle pip
function gladiatorInventory(arr) {
let inventory = arr.shift().split(" ");
const actions = {
Buy: (equipment) => buy(equipment),
Trash: (equipment) => trash(equipment),
Repair: (equipment) => repair(equipment),
Upgrade: (param) => upgrade(param)
};
function buy(eq) {
function bombNums(arr1, arr2) {
let [bomb, power] = arr2
for (let i = 0; i < arr1.length; i++) {
if (arr1[i] === bomb) {
arr1.splice(i - power > 0 ? i - power : 0, power * 2 + 1);
i = 0;
}
}
return arr1.reduce((a, v) => a + v, 0);