Skip to content

Instantly share code, notes, and snippets.

View anthony2025's full-sized avatar
🛵

Anthony Ascencio anthony2025

🛵
View GitHub Profile

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@siddharthkp
siddharthkp / reactivconf-2017-proposal.md
Last active February 25, 2024 10:06
Building applications for the next billion users
@bvaughn
bvaughn / why-is-react-devtools-showing-a-development-build-icon.md
Last active March 28, 2020 03:26
Find out why React DevTools is showing the dev-build icon

Ever wonder why a particular website is showing a development build icon for React DevTools? Here's how you can find out!

First copy/paste this well-annotated DevTools build-type-checker function into your browser console so you can run it.

Next, execute the following line in your developer console:

console.log(__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers);

If React is present on the page, you'll see something like:

// Imagine what would it be if connect, withRouter, injectIntl were child as function
export default (
<Connect mapStateToProps={mapStateToProps} mapPropsToActions={actions}>
{
(props) => (
<WithRouter>
{
(router) => (
<InjectIntl>
{(intl => <SomeComonent intl={intl} router={router} {...props} />}

Preact for Angular 1 Users

Here's my quick attempt to build a tiny preact app using terminology from Angular 1.

Installation

# get it
git clone https://gist.github.com/e5de4c33c1a8d8fd172905010d3ff75c.git preact-for-angular1-users
cd preact-for-angular1-users

Go here, select "View Bug Reporter", login, select "New", select "Bug Reporter".

Classification:

UI/Usability

Reproducability:

Always

Title:

App Store Review Guidelines should use different language when discouraging unqualified submissions to the app store

@markerikson
markerikson / cheng-lou-spectrum-of-abstraction.md
Last active May 7, 2025 01:53
Cheng Lou - "On the Spectrum of Abstraction" summarized transcript (React Europe 2016)

Cheng Lou - On the Spectrum of Abstraction

Cheng Lou, a former member of the React team, gave an incredible talk at React Europe 2016 entitled "On the Spectrum of Abstraction". That talk is available for viewing here: https://www.youtube.com/watch?v=mVVNJKv9esE

It's only a half-hour, but it is mind-blowing. It's worth re-watching two or three times, to let the ideas sink in.

I just rewatched the talk for some research, and wrote down a summary that's semi-transcript-ish. I didn't see any other transcripts for this talk, other than the auto-generated closed captions, so I wanted to share for reference.

Summary

import styled from ‘styled-components’;
const Score = styled.div`
 /* some styles here … */
 font-size: ${props => props.length <= 2 ? 62 : 45}px;
`;
@gaearon
gaearon / connect.js
Last active May 3, 2025 05:27
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@gaearon
gaearon / LinkThatWorksWithRedux.js
Last active November 21, 2018 03:31
Drop-in replacement for React Router <Link> that works with React Redux optimizations (https://github.com/reactjs/react-router/issues/470)
// While I claim this is a drop-in replacement, it is a little bit slower.
// If you have hundreds of links, you might spend a few more milliseconds rendering the page on transitions.
// KNOWN ISSUES WITH THIS APPROACH:
// * This doesn't work great if you animate route changes with <TransitionGroup>
// because the links are going to get updated immediately during the animation.
// * This might still not update the <Link> correctly for async routes,
// as explained in https://github.com/reactjs/react-router/issues/470#issuecomment-217010985.