Skip to content

Instantly share code, notes, and snippets.

View charpeni's full-sized avatar
🕳️
[object Object]

Nicolas Charpentier charpeni

🕳️
[object Object]
View GitHub Profile
@charpeni
charpeni / machine.js
Created March 17, 2023 19:24
Generated by XState Viz: https://xstate.js.org/viz
const CategoryName = {
RecoveryFlowRequest: 'RECOVERY_FLOW_REQUEST',
RecoveryFlowAckTimeout: 'RECOVERY_FLOW_ACK_TIMEOUT',
CKAutoSave: 'CK_AUTO_SAVE',
CKVersionMismatch: 'CK_VERSION_MISMATCH',
CKInternalConnection: 'CK_INTERNAL_CONNECTION',
CKComment: 'CK_COMMENT',
CKCollabComment: 'CK_COLLAB_COMMENT',
CKNameOfUndefined: 'CK_NAME_OF_UNDEFINED',
CKSessionNotFound: 'CK_SESSION_NOT_FOUND',
@charpeni
charpeni / The Technical Interview Cheat Sheet.md
Created November 20, 2017 01:04 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
class Component {
constructor(value) {
this.value = value;
}
@autobind
method() {
return this.value;
}
}
class D extends A {
}
console.log(D.prototype);
// A {constructor: ƒ}
console.log(D.prototype.__proto__);
// {constructor: ƒ, handleLongClick: ƒ}
class C extends A {
handleClick() {
super.handleClick();
console.log("C.handleClick");
}
}
console.log(C.prototype);
// A {constructor: ƒ, handleClick: ƒ}
class B extends A {
handleClick = () => {
super.handleClick();
console.log("B.handleClick");
}
handleLongClick() {
super.handleLongClick();
class A {
handleClick = () => {
console.log("A.handleClick");
}
handleLongClick() {
console.log("A.handleLongClick");
}
}
class A {
constructor() {
this.counter = 0;
this.handleClick = () => {
this.counter++;
};
}
handleLongClick() {
class A {
static color = "red";
counter = 0;
handleClick = () => {
this.counter++;
}
handleLongClick() {
this.counter++;
class ComponentA extends Component {
handleClick = () => {
// ...
}
render() {
// ...
}
}