Skip to content

Instantly share code, notes, and snippets.

View mr-wildcard's full-sized avatar

Julien Viala mr-wildcard

  • Shine
  • Bordeaux, France
View GitHub Profile
@ryanditjia
ryanditjia / AnchorLink.jsx
Last active September 27, 2021 12:36
Gatsby smooth anchor scroll + history “bug” fix
@vincentaudebert
vincentaudebert / SegmentedControl.js
Created October 31, 2016 22:50
Radio Buttons renderer
import React, { PropTypes } from 'react';
const SegmentedControl = ({ input, disabled, heading, required, className, items, name, meta: { touched, error } }) => (
<fieldset className={`form__field ${className || ''}`}>
<legend className="form__label">
{heading}{required ? (<span>*</span>) : null}
{ (touched && error) ? (
<span className="form__error"> {error}</span>
) : null }
@nikolasleblanc
nikolasleblanc / gist:b7680bfa8aa007fd84ffc8a32db613ea
Last active August 23, 2016 17:35
Upgrading to webpack 2
## package.json changes
"webpack": "^2.1.0-beta.20",
"typescript": "^2.0.0",
"webpack-dev-server": "^2.1.0-beta.0",
"webpack-hot-middleware": "^2.12.2",
"webpack-split-by-path": "^0.1.0-beta.1", <-- struggles, I've removed it
https://github.com/BohdanTkachenko/webpack-split-by-path/pull/22#issuecomment-240050461
@andrewmclagan
andrewmclagan / CreateUser.js
Last active May 7, 2020 11:51
[6.x.x] ReduxForm testing
import React, { Component, PropTypes } from 'react';
import { reduxForm, Field } from 'redux-form';
export class CreateUser extends Component {
static propTypes = {
createUser: PropTypes.func.isRequired,
initialValues: PropTypes.object,
submitting: PropTypes.bool.isRequired,
invalid: PropTypes.bool.isRequired,
@DmitrySoshnikov
DmitrySoshnikov / expression-only.md
Last active April 16, 2016 12:00
ES: Expression only

"Everything is an expression"... since ES1?

Many languages support "expression-only" semantics, allowing to use any construct in an expression position.

NOTE: the difference between expressions and statements is that the former produce a value, while the later don't.

For example, Ruby's if-expression:

x = 10
@cherta
cherta / actionCreators.js
Created January 19, 2016 17:19
redux-simple-router and sagas
export function retrieve(nodeId) {
return { type: 'RETRIEVE_NODE', payload: { nodeId: nodeId } }
}
export function show(nodes) {
return { type: 'SHOW_NODE', payload: { nodes: nodes } }
}
1. Build GraphQL server using `express-graphql` package.
2. Configure `schema.js` file.
3. Query for data.
@xjamundx
xjamundx / blog-webpack-2.md
Last active April 21, 2024 16:20
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@Dr-Nikson
Dr-Nikson / README.md
Last active June 8, 2023 12:04
Auth example (react + redux + react-router)
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note