Skip to content

Instantly share code, notes, and snippets.

View Sun1ive's full-sized avatar
🎯
Focusing

Sunlive Sun1ive

🎯
Focusing
  • Vinnitsa, Ukraine
View GitHub Profile
declare module 'MODULE_NAME' {
const module: any;
export = module;
}
// Object[Object], { {} } to string[];
Object.entries(this.formObject).map(([key, values]) => [key, ...Object.values(values)]);
Object.entries(this.formObject).map(([key, values]) => [key].concat(Object.values(values)));
// Dynamic generate Object with properties without re-writing existing
write(user: string, value: string, item: string) {
@Sun1ive
Sun1ive / docker + nginx + nodejs + pm2 + mongo.txt
Last active December 30, 2019 11:18
docker + nginx + nodejs + pm2 + mongo
# NGINX CONFIG
server {
listen 80 default_server;
listen [::]:80 default_server;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
@Sun1ive
Sun1ive / snippets
Last active July 2, 2018 20:59
Useful snippets
#flatten array with pretty much any depth
const flatten = (arr, depth = 1) =>
arr.reduce((a, v) => a.concat(depth > 1 && Array.isArray(v) ? flatten(v, depth - 1) : v), []);
// example
// const arr = [1,2,3,[2,3,4],[[2,5,3]],1];
// console.log('---', flatten(arr,2)); [1,2,3,2,3,4,2,5,3,1];
@media all and (max-width: 991px) { ... }
@media all and (max-width: 768px) { ... }
@media all and (max-width: 480px) { ... }
@media all and (max-width: 340px) { ... }
@Sun1ive
Sun1ive / mongo.txt
Last active June 14, 2018 09:14
mongodb docker
#docker-compose
version: '3.3'
services:
web:
image: nginx
restart: always
volumes:
- ./nginx/config:/etc/nginx/conf.d
- ./nginx/ssl:/etc/nginx/ssl
@Sun1ive
Sun1ive / nginx nuxt docker-compose
Created May 22, 2018 19:59
nginx nuxt docker-compose
## docker ##
version: '3.3'
services:
web:
image: nginx
restart: always
volumes:
- ./nginx/config:/etc/nginx/conf.d
ports:
@Sun1ive
Sun1ive / test-task.md
Created June 23, 2018 16:26 — forked from alpanyukov/test-task.md
Intern / Junior Front-End Developer Position: Test Task

Test Task for Intern / Junior Front-End Developer Position

Основная задача тестового не узнать как сильно вы знаете React, а посмотреть насколько хорошо вы сможете разобраться с новыми технологиями в относительно короткий срок. В идеале, на него нужно потратить не более 3 дней. А так - делайте сколько делается.

Описание

Нужно написать одностраничное приложения для просмотра фильмов с помощью The Movie Database API.

При открытии приложения, должен отображаться список популярных фильмов с пагинацией или динамической подгрузкой (на выбор). Также на странице должно быть поле для поиска. Когда ты вводишь туда какой-то текст, должны отобразиться фильмы которые ему соответствуют. Для каждого фильма в списке должен отображаться список жанров (названий жанров, не айдишек), к которым он принадлежит.

@Sun1ive
Sun1ive / postman-deb.sh
Created July 4, 2018 10:39 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
script=`basename "$0"`
if [ $# -gt 0 ] && [ "$1" = "-e" ]; then
e="-e"
fi
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
в tsconfig.json
],
"files": [
"src/*.d.ts"
]
в src/shims.d.ts
declare module '@fortawesome/*';
declare module 'v-click-outside-x';