Skip to content

Instantly share code, notes, and snippets.

View Karnak19's full-sized avatar

Basile Karnak19

View GitHub Profile
@martin-fv
martin-fv / PostList.stories.tsx
Last active April 5, 2024 19:41
Storybook mocking and Supertest with tRPC v10
import { Meta } from "@storybook/react/types-6-0";
import { PostList } from "../PostList";
import { getTRPCMock } from "../getTrpcMock";
export default {
title: "Components/PostList",
component: PostList,
} as Meta;
export const PostListPage = () => {
@bhubr
bhubr / skillbook-table.js
Last active February 5, 2020 13:27
skill book extract
const dupStudentCells = $('.allskills-table thead th.student-name').toArray();
const studentCells = dupStudentCells.slice(0, dupStudentCells.length / 2);
const studentNames = studentCells.map(c => c.innerText);
const skillCells = $('.allskills-table .skill-row').toArray()
.map(row => $(row).find('td').toArray().slice(2));
const isDone = td => $(td).hasClass('done');
const isOngoing = td => $(td).hasClass('ongoing');
const [TO_GAIN, ONGOING, DONE] = ['TO_GAIN', 'ONGOING', 'DONE'];
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@avinmathew
avinmathew / index.jsx
Created August 8, 2017 11:54
Multiple layouts with React Router v4
import React from "react"
import { Route, Switch } from "react-router-dom"
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => (
<Route {...rest} render={props => (
<Layout>
<Component {...props} />
</Layout>
)} />
)