Skip to content

Instantly share code, notes, and snippets.

View IacovColisnicenco's full-sized avatar
🏠
Working from home

Iacov Colisnicenco IacovColisnicenco

🏠
Working from home
View GitHub Profile
@IacovColisnicenco
IacovColisnicenco / gist:cb0cd5a8394269e2c846f4caf0f2cf67
Created December 2, 2022 21:57
Evolution of function calcAge(), I was inspired by Python style...
'use strict';
function calcAge(birthYear) {
const date = new Date().getFullYear();
const res = date - birthYear;
if (date !== birthYear) {
return res;
} else {
return console.log(`Год рождения не должен быть равен текушему ${date} году!`);
}
}
@IacovColisnicenco
IacovColisnicenco / gist:7770023a0f454b3a59d200478ed1c4e7
Created December 28, 2022 06:30
Замыкания в Javascript
const helloGuest = function(nameGuest) {
const dt = new Date();
const hour = dt.getHours();
return function(){
if(hour >= 0 && hour <6 ) {
console.log(`Good Night ${nameGuest}`);
}
else if (hour > 6 && hour < 12) {
@IacovColisnicenco
IacovColisnicenco / reinstall_drivers.bash
Created September 30, 2023 14:51 — forked from bartlomiejdanek/reinstall_drivers.bash
ubuntu - sound cart - reinstall drivers
#!/bin/bash
sudo su
apt-get --purge remove linux-sound-base alsa-base alsa-utils
apt-get install linux-sound-base alsa-base alsa-utils
apt-get install gdm ubuntu-desktop
reboot