Skip to content

Instantly share code, notes, and snippets.

View pietrovismara's full-sized avatar
🎯
Focusing

Pietro Paolo Vismara pietrovismara

🎯
Focusing
View GitHub Profile
@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@barneycarroll
barneycarroll / unfuckReact.js
Last active September 2, 2022 14:37
React components are so fucking stupid, it's unbelievable. 3 months with this library version 15 and the glaring stupidity of the API just keeps coming in waves. Fixing some of this stuff – just for the sake of internal consistency – would have been so simple. The number of hoops you're required to jump through for trivial shit. Ugh.
const mounted = new WeakSet()
export default (component, displayName = component.displayName || component.name || 'React.Component') => {
const host = {
[displayName] : class extends React.Component {
constructor(){
this.state = {}
component.apply(this, arguments)
}
@timetocode
timetocode / interp-sample.js
Created April 23, 2014 22:43
Entity interpolation
/* Entity Interpolation
this code occurs within the draw loop for an entity
this.x and this.y represent the most recently received server position of
the entity -- though i don't ever intend to use it for drawing
when an update is received (roughly every 50ms in my particular game) this.x and this.y get
pushed into previousState.x and previousState.y
i also continue sloppily onwards to previousPreviousState.x, but I've removed that code
@dideler
dideler / 0-startup-overview.md
Last active May 3, 2024 11:03
Startup Engineering notes