Skip to content

Instantly share code, notes, and snippets.

View mathieumg's full-sized avatar
🔧
Let's fix it!

Mathieu M-Gosselin mathieumg

🔧
Let's fix it!
View GitHub Profile
@orta
orta / index.md
Last active June 2, 2022 16:56
My Playground Preview

TSNYC Jan 2020


What is TypeScript?

TypeScript extends JavaScript by adding types.

@pftg
pftg / Yarn Upgrade Indirect Dependencies.md
Last active March 9, 2023 19:56
Update indirect dependencies in yarn.lock. `ruby rejuvenation.rb & yarn install`
$> curl "https://gist.githubusercontent.com/pftg/fa8fe4ca2bb4638fbd19324376487f42/raw/f9056244c416d2f56d6d94290e5ecef5960abf66/rejuvenation.rb" | ruby

or

$> ruby rejuvenation.rb
$> yarn install
@orlandovallejos
orlandovallejos / scrolling.js
Created November 12, 2019 17:37
scrolling helper for react-dnd ^9.4.0
/*------------------------------------------------*/
/* LIBRARIES
/*------------------------------------------------*/
import throttle from 'lodash/throttle';
/*------------------------------------------------*/
/* INTERNAL DEPENDENCIES
/*------------------------------------------------*/
import { MAIN_APP_SIDEBAR_ID } from '../../constants/global';
// This is a proper alternative to
// https://github.com/BuckleScript/bucklescript/blob/b9508105b1a35537bdea9a1fabd10f6c65f776b4/jscomp/bsb/templates/react-hooks/src/FetchedDogPictures/FetchedDogPictures.re#L14
// The one in that file uses Promise, but that's *wrong*.
// We only used promise as a demo of its API. We'll remove it soon.
// As you can see below, the pure XMLHttpRequest code is just as clean,
// less mysterious for all, more performant, extensible, and actually correct.
// Ignore these externals for now. They're just for illustration
// purposes. I just copy pasted the Js code from
@mjasnikovs
mjasnikovs / InputGuard.js
Created September 30, 2019 03:46
Input Guard for Apollo client local state management
import React, {Component} from 'react'
import PropTypes from 'prop-types'
const MAX_INT = 2147483647
const MIN_INT = -2147483648
const isNaturalNumber = input => {
return typeof input === 'number' && input % 1 === 0 && Number.isInteger(input) && input >= 0 && 1 / input !== -Infinity
}
@hydrosquall
hydrosquall / index.md
Last active January 8, 2022 19:35
Building Inclusive Code Review Culture
@Cellule
Cellule / reviewable-bindings.json
Last active November 14, 2024 15:40
Reviewable bindings
[
["f", "Show next/latest diffs", "setProposedDiffBounds()"],
["n", "Next unreviewed file", "nextUnreviewedFile()"],
["p", "Previous unreviewed file", "prevUnreviewedFile()"],
["shift+n", "Next changed file", "nextChangedFile()"],
["shift+p", "Previous changed file", "prevChangedFile()"],
[null, "Next visible file", "nextVisibleFile()"],
[null, "Previous visible file", "prevVisibleFile()"],
[null, "Next file", "nextFile()"],
@aeschright
aeschright / npm-strike.md
Last active September 8, 2021 16:32
A note about npm cli work status

When will [email protected] be released (and other PRs merged?)

On March 22, npm fired several members of the open source and community team for discussing workplace conditions and other labor organizing activities. As a result, core employee contributors to the npm cli were removed from the project, and others have left in solidarity or put their work on hold.

Multiple claims were filed with the NLRB on this matter. The NLRB has investigated and found sufficient evidence of validity to proceed. The National Labor Relations Act of 1935 protects US employees' right to engage in discussions of workplace concerns without threat of retaliation -- and awareness of the importance of how we treat each other is something I valued so much in collaborating with the cli team. How can we work together if we aren't free to discuss what we need?

It's disappointing for all of us to find the work we were doing interrup

@neomantra
neomantra / High_Performance_Redis.md
Last active January 14, 2025 16:07
Notes on running Redis with HPC techniques

High Performance Redis

In response to this brief blog entry, @antirez tweeted for some documentation on high-performance techniques for Redis. What I present here are general high-performance computing (HPC) techniques. The examples are oriented to Redis. but they work well for any program designed to be single- or worker-threaded and asynchronous (e.g. uses epoll).

The motivation for using these techniques is to maximize performance of our system and services. By isolating work, controlling memory, and other tuning, you can achieve significant reduction in latency and increase in throughput.

My perspective comes from the microcosm of my own bare-metal (vs VM), on-premises deployment. It might not be suitable for all scenarios, especially cloud deployments, as I have little experience with HPC there. After some discussion, maybe this can be adapted as [redis.io documentation](https://redis.io/do

overall
- everything can either be drawn at position (to position/entity) or at entity (to position/entity)
- everything can have the color changed / be tinted
- everything can be visible to everyone or only to specifc players or forces
- what is drawn on top? "Best" would be to draw the new stuff on top of the old stuff, so if you draw thing1 and then thing2, thing2 is on top of thing1
things that can be drawn
- line, dashed line