Skip to content

Instantly share code, notes, and snippets.

View faherrera's full-sized avatar
🏠
Working from home

Facundo Nahuel Herrera faherrera

🏠
Working from home
View GitHub Profile
@dmeents
dmeents / form-fields.js
Last active February 19, 2022 22:02
Rendering a select field in Redux-Form 6 with validation
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
export const renderSelect = field => (
<div>
<select {...field.input}/>
{field.touched && field.error && <div className="error">{field.error}</div>}
</div>
);
@singhshivam
singhshivam / Immutable JS Examples
Last active August 5, 2023 19:16
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);
@helpse
helpse / webpack.config.js
Created April 1, 2017 03:32
Webpack + dev server + hot reloading + pug + sass
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var src = path.join(__dirname, 'src');
var config = {
devServer: {
hot: true,
@maxan
maxan / web.config
Last active November 14, 2023 11:43
IIS Config to React Router App
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>