Skip to content

Instantly share code, notes, and snippets.

View gpbl's full-sized avatar

Giampaolo Bellavite gpbl

View GitHub Profile
@diegoconcha
diegoconcha / redux_egghead_notes.md
Last active January 18, 2022 13:23
Redux Egghead.io Notes

###Redux Egghead Video Notes###

####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.

Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.

####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree

[].forEach.call(document.querySelectorAll('img'), function (img) { if (/\.gif/i.test(img.src)) img.remove() })

Hi Zach :D

Modals are funny beasts, usually they are a design cop-out, but that's okay, designers have to make trade-offs too, give 'em a break.

First things first, I'm not sure there is such thing as a "simple" modal that is production ready. Certainly there have been times in my career I tossed out other people's "overly complex solutions" because I simply didn't understand the scope of the problem, and I have always loved it when people who have a branch of experience that I don't take the time

@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@mridgway
mridgway / BundlePlugin.js
Last active January 11, 2024 06:05
Bundle Plugin for Fluxible
/**
* On server, just register all of the resources directly to the plugin. On the client, pass in a loader file that maps bundle
* name to webpack bundle require (a separate entry point). Then from your action, you can call `context.loadBundle` to load
* the bundle resources. On the server, the resources are already available but on the client they will be lazy loaded by
* webpack.
*/
'use strict';
var debug = require('debug')('BundlePlugin');
var PromiseLib = global.Promise || require('es6-promise').Promise;

React-Core Meeting Notes 2015-03-20

Note: This is the first time we're sharing meeting notes publicly. The primary reason we haven't shared these is because we often mix public discussions with matters that are Facebook specific and should not be public. We're really trying to be more open about our development process and what's happening inside the project so moving forward, we'll be sharing meeting notes. While most of us do work at Facebook, we're committed to this being an open project - for now we'll filter out the private notes from the public notes. Hopefully we can make it possible for these meetings to be open to any who wish to attend.

Attendees:

  • @zpao
  • @sebmarkbage
  • @spicyj
  • @jeffmo
@th0r
th0r / Fluxible promisify plugin
Last active August 29, 2015 14:14
Fluxible plugin that allows to use promise-style actions
var Bluebird = require('bluebird');
module.exports = function promisifyPlugin(options) {
options = options || {};
/**
* Makes promisified `executeAction` method
*
* @param {Object} actionContext
* @returns {Function}

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@simenbrekken
simenbrekken / CategoryActions.js
Last active May 9, 2020 16:25
Category Actions
'use strict';
var createAsyncActions = require('./createAsyncActions')
var CategoryAPI = require('../api/CategoryAPI')
var CategoryActions = createAsyncActions({
create: function(category) {
CategoryAPI
.create(category)