Skip to content

Instantly share code, notes, and snippets.

View klinkov's full-sized avatar

Yuriy Klinkov klinkov

  • London
  • 16:07 (UTC +01:00)
View GitHub Profile
@klinkov
klinkov / protips.js
Created August 1, 2016 17:00 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@klinkov
klinkov / gist:505eac4507fd1e9dcc0e037a7cbc0d28
Created August 2, 2016 12:05
Metrics & Log Visualisation
Grafana
http://grafana.org/
Kibana (!)
https://habrahabr.ru/company/uteam/blog/278729/
https://github.com/reactjs/redux
https://facebook.github.io/react/
https://facebook.github.io/react-native/
https://facebook.github.io/immutable-js/
'use strict';
import PushNotification from "react-native-push-notification";
let _pushNotificationToken = null;
const _pushNotificationListeners = [];
function init() {
console.log("PushNotification init");
class CachedImage extends Component {
constructor(props) {
super(props)
this.state = {
cachedImagePath: null
}
}
componentWillMount() {
if (this.props.source)
@klinkov
klinkov / GIT
Last active September 11, 2019 21:22
git clone - выкачать репозиторий
git pull – получение изменений из удаленного репозитория
git checkout - переключиться на ветку
git checkout –b - отведение новой ветки от текущей с переключением на нее
git add – добавление файлов в индекс
git commit –m ‘’ – коммит с комментарием
git push origin - пуш закоммиченных изменений в удаленный репозиторий origin
git branch –d - локальное удаление ветки
git stash save –keep-index + git stash drop – локальное удаление изменений в отслеживаемых файлах
git rm -r --cached node_modules && git commit -m 'Remove the now ignored directory node_modules' - удаление node_modules
@klinkov
klinkov / navSaga.js
Created February 2, 2018 18:02 — forked from alexrussell/navSaga.js
Idea of how I have implemented a `goBackTo` saga for react-navigation.
export const goBackTo = function * goBackTo ({ payload: { routeName } }) {
const { nav } = yield select()
let targetIndex
for (let i = nav.index; i > 0; i--) {
if (nav.routes[i].routeName === routeName) {
targetIndex = i + 1
break
}
@klinkov
klinkov / README-Template.md
Created April 13, 2018 18:08 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

sudo killall AppleCameraAssistant;sudo killall VDCAssistant
@klinkov
klinkov / gist:3906133d124962bb8a5e6c797b866cee
Created January 21, 2019 09:49 — forked from shaiguitar/gist:627d52ebc0c03af488477b5d636a8909
Using docker compose to mount current working directory dynamically into the container
# mount volume PWD on host to /app in container.
shai@lappy ~/tmp/example-working-docker-compose-environment-vars [master *] ± % cat docker-compose.yml
version: "3"
services:
some_server:
...
volumes:
- $PWD:/app