Skip to content

Instantly share code, notes, and snippets.

View MicheleBertoli's full-sized avatar
🏖️
I'm taking a break from OSS.

Michele Bertoli MicheleBertoli

🏖️
I'm taking a break from OSS.
View GitHub Profile
@tlakomy
tlakomy / jQuery>React.markdown
Last active August 17, 2022 12:08
Let's not forget about jQuery

In this talk I'd like to use 5 minutes of my time to explain to the audience why jQuery is simply way better than React.

  • Does React have a fadeIn() method? Nah, I don't think so. You need to install a react-transition-group package which weighs over 3GB.
  • Can you do $.get(https://stackoverflow.com/questions/12345/adding_two_numbers_javascript) in React? NOPE.
  • Remember React 3.3.1? Me neither, because they didn't make it. Meanwhile in jQuery land: https://code.jquery.com/jquery-3.3.1.min.js
  • Can you learn jQuery for free? Sure! Can you learn React for free? It'll be $500 USD and your left kidney for a conference ticket.

And many, many more.

(This is a completely serious lightning talk proposal, I promise.)

// Option C:
// this implementation has a small amount of overhead compared to (a) and (b)
const React = require('react');
const counterState = React.createStateReducer({
initialState: props => ({
counter: 0,
divRef: React.createRef(),
}),
reducer: (action, state) => {

Head Over Heels for Snapshot Testing

Tests are interesting, because you're trying to test code. But to write tests, you have to write code. Who tests the tests? For tests to be worth it you need to be sure that for each line of code you add, the value being added is more than the liability.

Value > Liability

Because belive me, tests are a liability. First, they are code that

@joecritch
joecritch / updatein.js
Last active October 10, 2017 10:39
Immutable tree "updateIn"
function updateIn(tree, indexPath, replacement, childrenKey = 'children', depth = 0) {
function insert(ins) {
return tree
.slice(0, indexPath[depth])
.concat([ins])
.concat(tree.slice(indexPath[depth] + 1));
}
const lastDepth = indexPath.length - 1;
@busypeoples
busypeoples / FlowReactTutorial.js
Last active July 17, 2023 10:12
Flow Fundamentals For ReactJS Developers
//
// MIT License
//
// Copyright (c) 2018 Ali Sharif
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@threepointone
threepointone / rulesets.md
Last active September 14, 2017 18:54
rulegroup

Something about css-in-js libs I noticed, but no one really talks about. There exists an implicit idea of a grouped-ruleset, ie - a set of rulesets that apply either directly to an element, or are meant to be composed with other rulesets. an example with 2 libs -

// glamor

const button = css({
 color: 'red',
@edtsech
edtsech / lightning_talk_proposal.md
Last active January 31, 2023 07:29
Combining snapshot testing and component library -- ReactiveConf 2017 talk proposal

This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal!

Combining snapshot testing and component library

Do you test presentational logic of your components? No? Yes, but you feel like you are writing a lot of dummy tests? You even probably use snapshot tests for that, but don't feel like you make enought value from them..

If so, click 🌟 button on that Gist!

I'll talk how our team is using snapshot testing to iterate faster,

@okonet
okonet / lightning_talk_proposal.md
Last active April 10, 2018 10:09
Make linting great again! -- ReactiveConf 2017 ⚡️talk proposal

Please 🌟 this gist to vote for this proposal!

Make linting great again!

tabs vs spaces

No other topic in software development probably has so much controversy as linting.

With a wrong workflow linting can be really a pain and will slow you and your team down. With a proper setup, though, it can save you hours of manual work reformatting the code and reducing the code-review overhead.

@troch
troch / choosing-a-css-in-js-library.md
Last active October 18, 2020 17:52
Choosing a CSS in JS library

Choosing a CSS in JS library

Check comments below, this is only my opinion and a choice specific to my use case

We've architected a SPA to be universal-ready. It grew a lot, when we introduced code splitting we realised converting to CSS in JS was unavoidable in order to have pre-rendering and not load all our CSS up front. We've procrastinated on looking at CSS in JS properly, prioritasing immediate business needs, but kept an eye on industry evolutions.

Our CSS solution for components was a CSS companion file per component, imported with style / postCSS loader (with webpack) but no CSS modules: we were missing a tighter coupling between component rendering and styles. We were at the bottom of the CSS and componentization ladder, the following links have influenced us in choosing the right solution for us:

@frostney
frostney / talk.markdown
Last active September 4, 2017 21:16
ReactiveConf 2017 Lightning talk

This is a lightning talk proposal for ReactiveConf 2017: https://reactiveconf.com/

The Curious Case of Monorepos

Monorepos have often stigmatized as bad practice and as such something that should be avoided. Still, big companies like Facebook, AirBnB and Google are actively using monorepos to manage their projects. In the open source world, monorepos have become more popular with Babel being the most prominent example. We'll dive into why monorepos might have this bad reputation and go into where it makes sense to have monorepos, talk about their advantages and their shortcomings. We'll also look into what tooling solutions are available - especially in a JavaScript context.