Skip to content

Instantly share code, notes, and snippets.

View inkrot's full-sized avatar

Islam Zaripov inkrot

View GitHub Profile
@inkrot
inkrot / prisoners_and_100_boxes_task.js
Created March 11, 2023 12:32
Задача о 100 узниках и 100 ящиках
/*
* refs:
* https://ru.wikipedia.org/wiki/Задача_о_100_узниках_и_100_ящиках
* https://habr.com/ru/post/250817/
*/
function randomIntFromInterval(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min)
}
@inkrot
inkrot / CSS stepper
Last active September 28, 2022 15:14
// css
:root {
--circle-size: clamp(1.3rem, 5vw, 3rem);
--spacing: clamp(0.25rem, 2vw, 0.5rem);
}
.c-stepper {
display: flex;
}
.c-stepper__item {
@inkrot
inkrot / TelephoneInput.vue
Created February 28, 2021 14:09
Vue telephone input for Tailwind CSS
<template>
<div class="inline flex flex-row w-full rounded overflow-hidden border p-0"
:class="wrapperClass + (focused ? ' ' + wrapperFocusedClass : '')">
<div class="text-black p-2 m-0 flex justify-center items-center"
:class="prefixClass">
<span :class="prefixSpanClass">+7</span>
</div>
<input class="pl-3 w-full m-0"
type="tel"
Object.compare = (obj1, obj2) => {
for (let p in obj1) {
if (obj1.hasOwnProperty(p) !== obj2.hasOwnProperty(p)) return false;
if(obj1[p]===null && obj2[p]!==null) return false;
if(obj2[p]===null && obj1[p]!==null) return false;
switch (typeof (obj1[p])) {
case 'object':
if (!Object.compare(obj1[p], obj2[p])) return false;
break;
case 'function':
<template>
<div @click="$emit('click')"
@mousedown.capture="mousedown"
ref="button"
class="no-outline uns ripple-button">
<slot name="body"></slot>
<span class="circle"
v-if="show"
:class="{'animate': animate}"
:style="{