Skip to content

Instantly share code, notes, and snippets.


Nikita Butenko nkbt

View GitHub Profile
nkbt / Filters.jsx
Last active Apr 8, 2018
ImmutableJS + Redux
View Filters.jsx
import React from 'react';
import {List} from 'immutable';
import {shouldComponentUpdate} from 'react-addons-pure-render-mixin';
import {connect} from 'react-redux';
import getFiltersData from './filtersData';
import {filtersDataReady} from './reducer';
const Filters = React.createClass({
propTypes: {
getFiltersData: React.PropTypes.func.isRequired,
View i18n in react

Hi all, we have a problem doing i18n with React. This is about template strings.

What we need:

  By clicking SignUp, you accept our <a href="/terms">Terms of Service</a>

How I would do it (not in React):

module Test
  def get
    y x

  def x
View React-in-Angular.js
const React = require('react');
const FeedsContainer = require('./FeedsContainer');
const $inject = [];
const feeds = function () {
const link = ($scope, $element) => {
const node = $element.get(0);
$scope.$watch('feeds', f =>
React.render(<FeedsContainer isLoading={!f.length} feeds={f} />, node));
View .gitconfig
default = current
email =
name = Nik Butenko
autocrlf = input
excludesfile = /Users/nkbt/.gitignore
ignorecase = true
nkbt / generate-specs.js
Created Oct 13, 2015
Generate empty Jasmine specs for React components
View generate-specs.js
#!/usr/bin/env node
const glob = require('glob');
const path = require('path');
const fs = require('fs');
const mkdirp = require('mkdirp');
const args = global.process.argv.slice(2);
const sourcesRoot = args.shift() || path.join(__dirname, '..', 'src');
const specsRoot = args.shift() || path.join(__dirname, '..', 'spec');
✔ ~/nkbt/react-component-template [master|✔] 
13:25 $ `npm bin`/parallelshell '`npm bin`/eslint .' '`npm bin`/karma start ./karma.conf.js --single-run --reporters coverage'

  return binding.lstat(pathModule._makeLong(path));
Error: ENOENT, no such file or directory '/Users/nkbt/nkbt/react-component-template/reports/coverage/prettify.js'
    at Object.fs.lstatSync (fs.js:691:18)
    at Object.realpathSync (fs.js:1279:21)

Working with AWS makes me feel like coding in AST.

var params = {
  TableName: 'Table',
  AttributesToGet: [
  KeyConditions: {

Before each

# 1. use <version>
nvm use <version>

# 2. check version
node -v

# 3. remove node_modules
nkbt / .eslintrc.js
Last active Jan 24, 2021
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
"env": {
"browser": true,
"node": true,
"es6": true
"plugins": ["react"],
"ecmaFeatures": {