Skip to content

Instantly share code, notes, and snippets.

View danilichev's full-sized avatar
💭
take it easy

V. Danilichev danilichev

💭
take it easy
View GitHub Profile
@danilichev
danilichev / Multiple_GitHub_accounts_on_same_machine.md
Last active January 7, 2024 10:03
Multiple GitHub accounts on the same machine

Generate ssh key:

  ssh-keygen -t rsa -C "your-email-address" -f "github-username"

Example for personal github account bob and work github accound workerbob:

  ssh-keygen -t rsa -C "bob@email.com" -f "github-bob"
  ssh-keygen -t rsa -C "bob@workemail.com" -f "github-workerbob"
const withInitialParams = (initialParams = {}) =>
withProps(({ navigation }) => ({
navigation: R.set(
R.lensPath(['state', 'params']),
{
...initialParams,
...R.pathOr({}, ['state', 'params'], navigation),
},
navigation
),
import { ListView } from 'react-native';
import { compose, withProps } from 'recompose';
const withDataSource = withProps({
ds: new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }),
});
const withClonedDataSource = sourceName => withProps(({ ds, [sourceName]: source }) => ({
dataSource: ds.cloneWithRows(source),
}));
import { ListView } from 'react-native';
import { compose, withProps } from 'recompose';
import TransactionItem from './TransactionItem';
const withDataSource = withProps({
ds: new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }),
});
const withClonedDataSource = withProps(({ ds, transactions = [] }) => ({
dataSource: ds.cloneWithRows(transactions),
import React, { Component } from 'react';
import { ListView } from 'react-native';
import TransactionItem from './TransactionItem';
class TransactionsList extends Component {
constructor(props) {
super(props);
const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
this.state = {
dataSource: ds.cloneWithRows(props.transactions),
[user]
name = danilichev
email = v.danilichev@gmail.com
[push]
default = current
[alias]
co = commit
com = commit -m
cl = clone
ch = checkout
@danilichev
danilichev / redux-store-implement.js
Created October 28, 2016 19:21
implementing redux store
const createStore = (reducer) => {
let state;
const listeners = [];
const getState = () => state;
const dispatch = (action) => {
state = reducer(state, action);
listeners.forEach(listener => listener());
};
@danilichev
danilichev / curry.js
Last active September 17, 2016 10:35
curring
var curry = function (f) {
var arg = [];
var _curry = function () {
arg = arg.concat([].slice.call(arguments));
return arg.length === f.length ? f.apply(null, arg) : _curry;
};
return _curry;
};