Skip to content

Instantly share code, notes, and snippets.

View LopatkinEvgeniy's full-sized avatar

Евгений LopatkinEvgeniy

View GitHub Profile
@LopatkinEvgeniy
LopatkinEvgeniy / fetcher.js
Created September 30, 2016 14:31
Unrejectable fetch
import fetch from 'isomorphic-fetch';
export default function fetcher(url, options = {}) {
return new Promise((resolve) => {
fetch(url, Object.assign({}, {
credentials: 'same-origin',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
[user]
email = Lopatkin.E@raidixstorage.com
name = Lopatkin Evgeniy
[core]
editor = vim
[push]
default = simple
[alias]
hist = log --oneline --graph -7
st = status
@LopatkinEvgeniy
LopatkinEvgeniy / Enhance.js
Created January 13, 2016 09:33 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
// jshint node:true
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.initConfig({
handlebars: {
options: {
amd: true,
{
"folders":
[
{
"path": "/home/evgen/local",
"folder_exclude_patterns":
[
"bower_components",
"node_modules",
"public/templates"
@LopatkinEvgeniy
LopatkinEvgeniy / nodejs proxy
Last active February 10, 2017 20:33
nginx
# Простой пример
server {
listen 80;
server_name localhost;
charset koi8-r;
location / {
root /var/www/nodejs/public;
index index.html;
try_files $uri $uri/ @backend;
// jshint eqeqeq: false, -W041