Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lamtranweb on github.
  • I am lamtran (https://keybase.io/lamtran) on keybase.
  • I have a public key whose fingerprint is 79CE 2D94 2F2A 59EF F284 C8FC 6335 04A9 5CB1 EF7B

To claim this, I am signing this object:

@lamtranweb
lamtranweb / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lamtranweb
lamtranweb / full-width-scrollytelling-with-position-sticky-and-enterview.markdown
Created July 17, 2018 16:17
Full width scrollytelling with position sticky and enterview
Quiz
Slide
check -> Checked Slide
Checked Slide
next -> Slide
uncheck -> Slide
done -> Results
Results
reset -> Slide
@lamtranweb
lamtranweb / fetch-xstate-with-reset.tsx
Created May 25, 2019 06:46
fetch-xstate-with-reset
import * as React from 'react';
import { render } from 'react-dom';
import { Machine, assign } from 'xstate';
import { useMachine } from '@xstate/react';
import { useEffect, useMemo, ReactNode } from 'react';
import './styles.css';
const URL = 'https://jsonplaceholder.typicode.com/todos/1';
@lamtranweb
lamtranweb / fetch-with-useReducer-with-reset.tsx
Created May 25, 2019 06:48
fetch-with-useReducer-with-reset
import * as React from 'react';
import { ReactNode, useReducer } from 'react';
import { render } from 'react-dom';
import './styles.css';
const URL = 'https://jsonplaceholder.typicode.com/todos/1';
interface Todo {
id: number;
@lamtranweb
lamtranweb / fetch-xstate-with-URL-check.tsx
Created May 25, 2019 06:49
fetch-xstate-with-URL-check
import * as React from "react";
import { render } from "react-dom";
import { Machine, assign } from "xstate";
import { useMachine } from "@xstate/react";
import { useEffect, useMemo, ReactNode } from "react";
import "./styles.css";
const URL = "https://jsonplaceholder.typicode.com/todos/1";
@lamtranweb
lamtranweb / fetch-with-URL-check.tsx
Created May 25, 2019 06:50
fetch-with-URL-check
import * as React from "react";
import { useState, useEffect, ReactNode } from "react";
import { render } from "react-dom";
import "./styles.css";
const URL = "https://jsonplaceholder.typicode.com/todos/1";
interface Todo {
id: number;
@lamtranweb
lamtranweb / fetch-with-ts-remote-data.tsx
Created May 25, 2019 06:51
fetch-with-ts-remote-data
import * as React from "react";
import { render } from "react-dom";
import RemoteData from "ts-remote-data";
import "./styles.css";
import { useState, useEffect, ReactNode } from "react";
const URL = "https://jsonplaceholder.typicode.com/todos/1";
interface Todo {
@lamtranweb
lamtranweb / ts-remote-data-xstate.tsx
Created May 25, 2019 06:52
ts-remote-data-xstate
import * as React from "react";
import { render } from "react-dom";
import RemoteData from "ts-remote-data";
import { Machine, assign, DefaultContext } from "xstate";
import { useMachine } from "@xstate/react";
import { useEffect, useMemo, ReactNode } from "react";
import "./styles.css";
const URL = "https://jsonplaceholder.typicode.com/todos/1";