Skip to content

Instantly share code, notes, and snippets.

View ippatev's full-sized avatar
🎯
Focusing

Aleksandr Ippatev ippatev

🎯
Focusing
View GitHub Profile
@ippatev
ippatev / index.js
Created April 2, 2025 03:47
isLeapYear
const isLeapYear = (year) => year % 4 === 0 &&
(year % 100 !== 0 || year % 400 === 0);
@ippatev
ippatev / answerfile
Created September 25, 2024 16:29 — forked from oofnikj/answerfile
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
nvim $(fzf -m --preview="cat {}")
@ippatev
ippatev / 00-README-NEXT-SPA.md
Created March 19, 2023 00:26 — forked from gaearon/00-README-NEXT-SPA.md
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Building

@ippatev
ippatev / metrials-go.md
Created January 18, 2023 14:05 — forked from egorsmkv/metrials-go.md
Материалы по Go (golang): мануалы, статьи, книги и ссылки на сообщества

Материалы по Go (golang)

На русском языке

Мануалы и туториалы

  • [Введение в программирование на Go][1]
  • [Маленькая книга о Go][3]
  • [Эффективный Go][2]
  • Есть еще [Краткий пересказ Effective Go на русском языке][4], но 2009 года
@ippatev
ippatev / upload.js
Created January 17, 2023 06:04 — forked from virolea/upload.js
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@ippatev
ippatev / index.js
Created June 30, 2022 21:36
Get random text in texts array
const texts = ['Oh Noo!!', 'You lost!', 'Try a next time!!'];;
text = texts[Math.floor(Math.random() * texts.length)];
console.log(text)
@ippatev
ippatev / index.ts
Created March 1, 2022 12:44
Rxjs Subjects with functions
handleLoadChat: Subject<void> = new Subject<void>();
this.handleLoadChat.pipe(debounceTime(500)).subscribe(() => this.loadChat());
this.handleLoadChat.next();
@ippatev
ippatev / index.md
Created February 11, 2022 11:24
Как смерджить родителя и дочернею ветку, находясь на дочерней ветке
git pull origin PARENT_NAME
git merge PARENT_NAME

Потом разрешить выявленные конфликтные изменения

@ippatev
ippatev / index.css
Created February 5, 2022 16:17
Gradient button at youtube CSS
.yt-chip-cloud-chip-renderer[chip-style=STYLE_REFRESH_TO_NOVEL_CHIP][selected] {
transition: background 2s;
border: 1px solid transparent;
background-image: linear-gradient(45deg,var(--yt-spec-assistive-feed-themed-gradient-1),var(--yt-spec-assistive-feed-themed-gradient-2),var(--yt-spec-assistive-feed-themed-gradient-3)),linear-gradient(45deg,var(--yt-spec-assistive-feed-vibrant-gradient-1),var(--yt-spec-assistive-feed-vibrant-gradient-2),var(--yt-spec-assistive-feed-vibrant-gradient-3));
background-clip: padding-box,border-box;
background-origin: border-box,border-box;
}