Skip to content

Instantly share code, notes, and snippets.

@zogreptile
zogreptile / gray-yamap.css
Created April 26, 2018 00:09
Черно-белая яндекс карта.
[class*="ymaps-2"][class*="-ground-pane"] {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
-webkit-filter: grayscale(100%);
}
@zogreptile
zogreptile / breadcrumbs.txt
Created July 9, 2018 00:47
Типовой breadcrumbs - nunjucks, scss, модель данных
<nav class="breadcrumbs">
<div class="container">
<ul class="breadcrumbs__list">
{% for item in BREADCRUMBS_DATA %}
<li class="breadcrumbs__item">
{% if loop.last %}
<span>{{ item.text }}</span>
{% else %}
<a href="{{ item.url }}">{{ item.text }}</a>
{% endif %}

Flow

mini GitHub API client

First screen: owner (organization or user) name input and submit button.

Treat organizations as users: unconditionally use /users/${owner}/repos API.

On submit: show cards with repositories, filters, and sorting.

@zogreptile
zogreptile / deploy.md
Last active March 20, 2019 11:17
Deploy to gh-pages with github access token

package.json

"homepage": "https://<username>.github.io/<reponame>",
"scripts": {
  "predeploy": "npm|yarn run build",
  "deploy": "gh-pages -d build"
}

Github

1. Расскажите, чем, на ваш взгляд, отличается хорошее клиентское приложение от плохого с точки зрения

Пользователя:
  • интуитивно-понятное
  • отзывчивое
  • быстрое
  • приятно выглядящее
Менеджера проекта:
  • не вызывает лишних вопросов со стороны заказчика/начальства
  • сделано в заявленные сроки
@zogreptile
zogreptile / wincmd.md
Last active April 11, 2019 06:06
Windows commands

Удаление вложенных папок

rmdir <directory> /s /q

  • /s – удаление подпапок
  • /q – отключение запроса подтверждения при удалении дерева каталогов с помощью ключа /s

Переход к другому диску

cd /d d:\Docs\Java

@zogreptile
zogreptile / gitcommands.md
Last active September 24, 2019 11:16
Git commands

Вывод истории коммитов

git log -5 --pretty=%s --graph

Обнулить локальную ветку удаленной (на случай тотальной осечки)

  • delete your local branch: git branch -d local_branch
  • fetch the latest remote branch: git fetch origin remote_branch
  • rebuild the local branch based on the remote one: git checkout -b local_branch origin/remote_branch

Откатить коммит(ы) с сохранением отслеживания файлов в индексе

git reset --soft (HEAD^) – откатить последний коммит

Использование глобальных npm-пакетов в git-bash

Добавить в PATH путь к бинарникам npm, например C:\Users\\AppData\Roaming\npm

@zogreptile
zogreptile / svg-progress.jsx
Last active September 11, 2020 09:16
Semi-circle react svg progress bar.
const propTypes = {
progressPercent: PropTypes.number,
};
const defaultProps = {
progressPercent: 0,
};
const WIDTH = 224;
const HEIGHT = 112;
// export values from SCSS file
:export {
tablet-portrait: $tablet-portrait;
desktop: $desktop;
}
// JS
import BREAKPOINTS from '../breakpoints.scss';
const isMatchesMQ = window.matchMedia(`(min-width: ${BREAKPOINTS.desktop})`).matches;