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 / 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
@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 / 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:f1344d01262945a38e43f42e930120a6
Created November 25, 2022 19:26
Example js object with method
// Online Javascript Editor for free
// Write, Edit and Run your Javascript code using JS Online Compiler
const obj = {
name: 'Iacov',
age: function(yearOfBirth) {
const date = new Date().getFullYear();
const res = date - yearOfBirth;
return console.log(`I'm ${res} years old`);
import java.util. *;
public class MyClass {
public static void main(String args[]) {
class User {
int age;
String name;
@IacovColisnicenco
IacovColisnicenco / Java Example Class
Created May 26, 2022 15:33
Simple example of java class for beginner
import java.util. *;
public class MyClass {
public static void main(String args[]) {
class Customer {
int amountOfPurchases;
String name;
@IacovColisnicenco
IacovColisnicenco / build.gradle
Last active December 18, 2021 19:48
Room, ViewModel|Life Cycles, Coroutines - connect dependencies
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
def room_version = "2.3.0"
def lifecycle_version = "2.3.1"
def arch_version = "2.1.0"
def coroutines_version = "1.5.0"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
@IacovColisnicenco
IacovColisnicenco / js
Created April 1, 2021 17:46
nameLengths
let arr = ['html', 'css', 'javascript'];
let nameLengths = arr.map((name) => name.length);
console.log(nameLengths);
let arr = ['html', 'css', 'javascript'];
let nameLengths = arr.map((name) => name.length);
console.log(nameLengths);
let arr = [1, 2, 3, 4];
let arg = prompt("input your number", "0");
if (arg != null) {
searchElem(arg);
} else {
console.log("Cancel was pressed");
}
function searchElem(arg){