Skip to content

Instantly share code, notes, and snippets.

Avatar

Mithi Sevilla mithi

View GitHub Profile
@Ciantic
Ciantic / example-typeorm-jest.test.ts
Created Apr 16, 2019
Example of testing TypeOrm with Jest and Sqlite in-memory database
View example-typeorm-jest.test.ts
import { createConnection, getConnection, Entity, getRepository } from "typeorm";
import { PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class MyEntity {
@PrimaryGeneratedColumn()
id?: number;
@Column()
name?: string;
View axis.d.ts
declare module '@vx/axis' {
import React from 'react';
import { ScaleTime } from 'd3-scale';
interface Point {
x: number;
y: number;
}
interface AxisProps {
View advanced-react-notes.md

Advanced React by React Training

Personal notes while working through Advanced React: https://courses.reacttraining.com/p/advanced-react

Granted this is a contrived example, but it's still something I took notice to: in those "Advanced React" videos I've been watching, Ryan Florence codes very slowly, and does not make one quick change and jump back to the browser to see what changed.

He stops and thinks. He asks himself (or the viewer) questions. He wonders what

@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active Jan 17, 2022
How to add a collapsible section in markdown.
View markdown-details-collapsible.md

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@guillaumegarcia13
guillaumegarcia13 / html_forms_cheatsheet.md
Created Apr 4, 2017
HTML forms and input tags cheatsheet. All you need to know to write every HTML form possible, including links to good resources on HTML and the new HTML5 form and input options...
View html_forms_cheatsheet.md

HTML Forms

In order that you never go to W3Schools (never go there), here is a basic cheat sheet for writing simple HTML forms.

This is culled from a few sources, [the most important being MDN][MDN]. MDN (the Mozilla Developer Network) should be seen as "the docs" when you are having an issue with HTML.

@hediet
hediet / main.md
Last active Jan 14, 2022
Proof that TypeScript's Type System is Turing Complete
View main.md
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@slavikdev
slavikdev / cheatsheet.md
Created Mar 16, 2017
Rails request path cheatsheet
View cheatsheet.md

Rails request path cheatsheet

Full path with query string

>>  request.url
=> "http://localhost:3000/ask-help.amp?hui=pizda"

Virtual path without query string

>>  request.path
=> "/ask-help.amp"
@jonathansick
jonathansick / query.graphql
Last active Aug 5, 2021
GitHub GraphQL repo commit history query
View query.graphql
{
repository(name: "sickvim", owner: "jonathansick") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 5) {
pageInfo {
hasNextPage
}
@joncardasis
joncardasis / Storing-Images-On-Github.md
Last active Jan 15, 2022
Storing Images and Demos in your Repo
View Storing-Images-On-Github.md

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets