isCreatedUser : !this.isEdit ? true : false

Vue.js project, someone wanted to verify if the user was being edited or created...

By rat, 2021-10-21 17:11:54
const handleBoolean = value => {
        switch (value) {
            case "true":
                return true;
            case true:
                return "true";
            case "false":
                return false;
            case false:
                return "false"
            default:
                return null;
        }
    }
By Anonymous, 2021-09-29 11:53:22
'use strict'

// exports //

module.exports = Math.sqrt
By Igor, 2021-09-01 21:28:26
for (const order of orders) {
    for (const resultItem of results) {
        if (resultItem.machine != "TRANSFER") {
            shiftsLoop: for (const shift of resultItem.shifts) {
                if (shift.products) {
                    for (const product of shift.products) {
                        if (product.product == order.product) {
                            for (const routing of routings) {
                                if (routing.output == order.product) {
                                    const machinePlant = findMachinePlant(resultItem.machine, machines)
                                    if (routing.type == "ODP") {
                                        if (machinePlant == order.plant) {
                                            const msg = createMessage(order, shift, resultItem.machine, CHOR)
                                            requests.push(buildRequest(msg))
                                        } else {
                                            //CHEE CHIE CHEI
                                        }
                                        break shiftsLoop
                                    } else if (routing.type == "OCL" || routing.type == "RCL") {
                                        const msg = createMessage(order, shift, resultItem.machine, CHCL)
                                        requests.push(buildRequest(msg))
                                        //CHCL
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
By sgaloppo, 2021-08-28 20:28:59

class Timer extends React.Component{
    state ={
        time: 10
    };
    setInvt = () =>{
        let t = this.state.time
        if(t<=1){
            clearInterval(this.invertal)
        }
        this.setState({time: t-1})
    }
    componentDidMount(){
        this.invertal = setInterval(this.setInvt, 1000)
    }

    render(){
        return (<label>{this.state.time}</label>)
    }
}

export {Timer}
By Anonymous, 2021-07-30 21:13:46
if(year%100 === 79 ||
year%100 === 90 ||
year%100 === 1 ||
year%100 === 7 ||
year%100 === 18) {
	if(month === 1) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 28);}}
	if(month === 3) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 5)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 5)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 79 ||
year2%100 === 90 ||
year2%100 === 1 ||
year2%100 === 7 ||
year2%100 === 18) {
	if(month2 === 1) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
	if(month2 === 3) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 5)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 5)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 79 ||
year3%100 === 90 ||
year3%100 === 1 ||
year3%100 === 7 ||
year3%100 === 18) {
	if(month3 === 1) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
	if(month3 === 3) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 5)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 5)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 96) {
	if(month === 1) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 29);}}
	if(month === 3) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 96) {
	if(month2 === 1) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
	if(month2 === 3) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 96) {
	if(month3 === 1) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
	if(month3 === 3) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 85 ||
year%100 === 91 ||
year%100 === 2 ||
year%100 === 13 ||
year%100 === 19) {
	if(month === 1) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 28);}}
	if(month === 3) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 85 ||
year2%100 === 91 ||
year2%100 === 2 ||
year2%100 === 13 ||
year2%100 === 19) {
	if(month2 === 1) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
	if(month2 === 3) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 85 ||
year3%100 === 91 ||
year3%100 === 2 ||
year3%100 === 13 ||
year3%100 === 19) {
	if(month3 === 1) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
	if(month3 === 3) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 80 ||
year%100 === 8) {
	if(month === 1) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 29);}}
	if(month === 3) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 80 ||
year2%100 === 8) {
	if(month2 === 1) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
	if(month2 === 3) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 80 ||
year3%100 === 8) {
	if(month3 === 1) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
	if(month3 === 3) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 86 ||
year%100 === 97 ||
year%100 === 3 ||
year%100 === 14) {
	if(month === 1) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 28);}}
	if(month === 3) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 92) {
	if(month === 1) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 29);}}
	if(month === 3) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while(day%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 86 ||
year2%100 === 97 ||
year2%100 === 3 ||
year2%100 === 14) {
	if(month2 === 1) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
	if(month2 === 3) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 92) {
	if(month2 === 1) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
	if(month2 === 3) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 86 ||
year3%100 === 97 ||
year3%100 === 3 ||
year3%100 === 14) {
	if(month3 === 1) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
	if(month3 === 3) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 92) {
	if(month3 === 1) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
	if(month3 === 3) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 81 ||
year%100 === 87 ||
year%100 === 98 ||
year%100 === 9 ||
year%100 === 17) {
	if(month === 1) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while(day%7 ===0) {day=Math.ceil(Math.random() * 28);}}
	if(month === 3) { while(day%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while(day%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year%100 === 4) {
	if(month === 1) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 2) { while(day%7 ===0) {day=Math.ceil(Math.random() * 29);}}
	if(month === 3) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 4) { while((day - 5)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 5) { while((day - 3)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 6) { while(day%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 7) { while((day - 5)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 8) { while((day - 2)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 9) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 10) { while((day - 4)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
	if(month === 11) { while((day - 1)%7 ===0) {day=Math.ceil(Math.random() * 30);}}
	if(month === 12) { while((day + 1)%7 ===0) {day=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 81 ||
year2%100 === 87 ||
year2%100 === 98 ||
year2%100 === 9 ||
year2%100 === 17) {
	if(month2 === 1) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 28);}}
	if(month2 === 3) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year2%100 === 4) {
	if(month2 === 1) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 2) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 29);}}
	if(month2 === 3) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 4) { while((day2 - 5)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 5) { while((day2 - 3)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 6) { while(day2%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 7) { while((day2 - 5)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 8) { while((day2 - 2)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 9) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 10) { while((day2 - 4)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
	if(month2 === 11) { while((day2 - 1)%7 ===0) {day2=Math.ceil(Math.random() * 30);}}
	if(month2 === 12) { while((day2 + 1)%7 ===0) {day2=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 81 ||
year3%100 === 87 ||
year3%100 === 98 ||
year3%100 === 9 ||
year3%100 === 17) {
	if(month3 === 1) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 28);}}
	if(month3 === 3) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
if(year3%100 === 4) {
	if(month3 === 1) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 2) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 29);}}
	if(month3 === 3) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 4) { while((day3 - 5)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 5) { while((day3 - 3)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 6) { while(day3%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 7) { while((day3 - 5)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 8) { while((day3 - 2)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 9) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 10) { while((day3 - 4)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
	if(month3 === 11) { while((day3 - 1)%7 ===0) {day3=Math.ceil(Math.random() * 30);}}
	if(month3 === 12) { while((day3 + 1)%7 ===0) {day3=Math.ceil(Math.random() * 31);}}
}
By Anonymous, 2021-06-22 15:46:00
pageEndReached() {
      if (!this.endOfResults) {
        //load more pages
        this.page++;
        this.getPosts();
      followerCount: null,
      postCount: null,
      measurementKeys: ["a", "b", "c", "d", "e"],
      showDrafts: false,
    };
  },

nani

By sonic, 2021-06-08 22:52:01
$(document).on('click', '.edit-item', function(event) {
    let row_id = event.currentTarget.attributes['data-row'].value,
    data = dataIndex[
        dataIndex.findIndex(i => i.id === Number(row_id))
    ];
    $('.modal-body div:nth-child(1) input').attr('value', data.name)
    $('.modal-body div:nth-child(2) input').attr('value', data.category)
    $('.modal-body div:nth-child(3) #basicSelect').val(data.status)
    $('.modal-body div:nth-child(4) input').attr('value', data.price)
    $('.modal-body div:nth-child(5) input').attr('value', data.bju.mass)
    $('.modal-body div:nth-child(6) input').attr('value', data.bju.calories)
    $('.modal-body div:nth-child(7) input').attr('value', data.bju.proteins)
    $('.modal-body div:nth-child(8) input').attr('value', data.bju.fats)
    $('.modal-body div:nth-child(9) input').attr('value', data.bju.carbohydrates)
}
)
By Nik Destrave, 2021-05-30 21:59:31
let already_in = True;
while (already_in) {
    let random_index = Math.floor(arr.length * Math.random());
    let already_in = False;
    for (ex of exs) {
        if (ex.id === arr[random_index].id) {
            already_in = True;
        }
    }
}

Yes, this is JavaScript, and yes it didn't work. Found while reviewing some code

By L., 2021-05-17 11:20:12
let foo = {} // object no. 1
let bar = {} // object no. 2

foo > bar // return false
foo < bar // return false, so maybe foo equals bar?
foo == bar // oh well, return false
// but
foo >= bar // return true, 'cause !(foo < bar) == true

return value is expected, but JS is funny

By Anonymous, 2021-03-12 21:08:32
    self.isOptionsVisible = ko.computed(function() {
        if((self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
            return true;
        }

        return false;
    }, this);

    self.isNameVisible = ko.computed(function() {
        if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
            return true;
        }

        return false;
    }, this);

    self.isBeforeAfterImagesVisible = ko.computed(function() {
        if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
            return true;
        }

        return false;
    }, this);

    self.isTooltipVisible = ko.computed(function() {
        if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
            return true;
        }

        return false;
    }, this);

    self.isLabelVisible = ko.computed(function() {
        if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload') || (self.type() == 'info')) {
            return true;
        }

        return false;
    }, this);

    self.isClassVisible = ko.computed(function() {
        if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
            return true;
        }

        return false;
    }, this);

    self.isStyleVisible = ko.computed(function() {
        if((self.type() == 'text') || (self.type() == 'textarea') || (self.type() == 'select') || (self.type() == 'multiselect') || (self.type() == 'radio') || (self.type() == 'checkbox') || (self.type() == 'upload')) {
            return true;
        }

        return false;
    }, this);

object orientation overrated. let's check the fields in several places ...

By Dude, 2020-12-16 12:25:17
if (!response ||
    !response.data ||
    !response.data.success ||
    response.data.success == false ) {
        //process stuff
}

Not talking about the '===' warning, here

By Anonymous, 2020-12-02 12:31:00
var state = getCookie("state");
function checkCookie(args) {
  if (state == args) {
    return true;
  } else {
    alert("Request denied. Invalid auth code provided.");
    return false;
  }
}
const tokenElement = document.getElementsByName("dream");
var loginSrv = checkCookie(getAllUrlParams().state);
document.cookie = `state=${getAllUrlParams().state}; path=/`;
tokenElement.innerText = getAllUrlParams().code;
if (getAllUrlParams().state != loginSrv) {
  alert(`Incorrect auth code provided. The correct code is ${state}`);
}

If they provide the wrong oauth state code, tell the user the correct one!

By Demonitized, 2020-08-31 22:12:37
// var array = retrieveArrayValue();
var filteredArray = array.filter(function (element, index, array) {
    return array.indexOf(element) == index;
});
// processArray(filteredArray);
By Anonymous, 2020-08-20 11:24:51

function atoi(charstring)
{
  if(charstring=="a") return 0x61;if(charstring=="b") return 0x62;
  if(charstring=="c") return 0x63;if(charstring=="d") return 0x64;
  if(charstring=="e") return 0x65;if(charstring=="f") return 0x66;
  if(charstring=="g") return 0x67;if(charstring=="h") return 0x68;
  if(charstring=="i") return 0x69;if(charstring=="j") return 0x6a;
  if(charstring=="k") return 0x6b;if(charstring=="l") return 0x6c;
  if(charstring=="m") return 0x6d;if(charstring=="n") return 0x6e;
  if(charstring=="o") return 0x6f;if(charstring=="p") return 0x70;
  if(charstring=="q") return 0x71;if(charstring=="r") return 0x72;
  if(charstring=="s") return 0x73;if(charstring=="t") return 0x74;
  if(charstring=="u") return 0x75;if(charstring=="v") return 0x76;
  if(charstring=="w") return 0x77;if(charstring=="x") return 0x78;
  if(charstring=="y") return 0x79;if(charstring=="z") return 0x7a;
  if(charstring=="0") return 0x30;if(charstring=="1") return 0x31;
  if(charstring=="2") return 0x32;if(charstring=="3") return 0x33;
  if(charstring=="4") return 0x34;if(charstring=="5") return 0x35;
  if(charstring=="6") return 0x36;if(charstring=="7") return 0x37;
  if(charstring=="8") return 0x38;if(charstring=="9") return 0x39;
  if(charstring==".") return 0x2e;
  return 0x20;
}

found in a proxy script

By Anonymous, 2020-08-10 03:17:52