See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
import { match, P } from "ts-pattern"; | |
const headerBlocType = { | |
Header: "header", | |
Paragraph: "paragraph", | |
Image: "image", | |
} as const; | |
interface HeadBlockData { | |
text: string; |
import torch | |
import torch.nn as nn | |
class SelfAttention(nn.Module): | |
def __init__(self, embed_size, heads): | |
super(SelfAttention, self).__init__() | |
self.embed_size = embed_size | |
self.heads = heads | |
self.head_dim = embed_size // heads | |
import { makeAutoObservable } from "mobx"; | |
type Choice = { | |
id: number; | |
text: string; | |
}; | |
type Question = { | |
id: number; | |
text: string; |
import { useEffect, useState } from "react"; | |
class EventBus<T> { | |
_handlers: Set<(t: T) => void> = new Set(); | |
subscribe(handler: (t: T) => void) { | |
this._handlers.add(handler); | |
} | |
unsubscribe(handler: (t: T) => void) { | |
this._handlers.delete(handler); | |
} |
// Avec readux toolkit : | |
import { createSlice } from '@reduxjs/toolkit' | |
export const counterSlice = createSlice({ | |
name: 'counter', | |
initialState: { | |
value: 0, | |
}, | |
reducers: { | |
increment: (state) => { |
import {useFriend} from '../model/useFriend' | |
export function FriendLine ({friend}) { | |
const {fullname, deleteFriend} = useFriend(friend) | |
return (<tr> | |
<td>{fullname}</td> | |
<td><button onclick={deleteFriend} /></td> | |
</tr>); | |
} |
class FriendViewModel { | |
_personalId; | |
_friend; | |
constructor(personalId, friend) { | |
this._personalId = personalId; | |
this._friend = friend; | |
} | |
delete() { |
// Implement a firestore data provider for react-admin | |
import { | |
GET_LIST, | |
GET_ONE, | |
CREATE, | |
UPDATE, | |
UPDATE_MANY, | |
DELETE, | |
DELETE_MANY, |