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:bb3a800a0a91165f81126325da845db1
Created February 25, 2021 14:15
box-sizing — best practice
html{
box-sizing: border-box;
}
*, *::before, *::after{
box-sizing: inherit;
}
body {
font-size: 18px;
font-family: 'Fira Sans', sans-serif;
line-height: 1.5em;
min-height: 100vh;
background-color: #e5e5e5;
}
@IacovColisnicenco
IacovColisnicenco / js
Created April 1, 2021 16:21
Вывод слов из 5 символов+
let str = 'Lorem ipsuma is simply dummy loreman';
let arr = str.split (' ');
for (let i = 0; i < arr.length; i++){
if(arr[i].length >= 5) {
console.log(arr[i]);
}
}
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){
let arr = ['html', 'css', 'javascript'];
let nameLengths = arr.map((name) => name.length);
console.log(nameLengths);
@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);
@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 / 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;
import java.util. *;
public class MyClass {
public static void main(String args[]) {
class User {
int age;
String name;
@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`);