Skip to content

Instantly share code, notes, and snippets.

⌨️
Typing...

Shu Ding quietshu

⌨️
Typing...
Block or report user

Report or block quietshu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View smoothscroll.js
// SmoothScroll
class SmoothScroll {
constructor() {
// the <main> element
this.DOM = {main: document.querySelector('main')};
// the scrollable element
// we translate this element when scrolling (y-axis)
this.DOM.scrollable = this.DOM.main.querySelector('div[data-scroll]');
// the items on the page
this.items = [];
View swr-patterns.md
// /swr/project.js
import useSWR, { mutate } from 'swr'

export async function fetchProject (id) {
  mutate(`/api/project/${id}`, fetch(`/api/project/${id}`))
}

export default function useProject (id) {
  // don't pass the fetcher so it won't fetch
View visitingmit.md

The sky is overcast now, the crowds of students have thinned out, and those that remain scurry from place to place with their heads down. I’m tired now, I feel sadder, and I wonder how I lost so much so quickly.

-- aaronsw

View readme.txt
Play this game by pasting the script in https://cyatheatree.github.io/PuzzleScript/editor.html
View game.txt
{"canvasIndex":0,"gameLink":"www.flickgame.org","canvasses":[[1822,"2",3,"0",196,"2",5,"0",195,"2",5,"0",50,"2",5,"0",24,"2",5,"0",17,"2",3,"0",2,"2",7,"0",24,"2",3,"0",54,"2",6,"0",11,"2",3,"0",8,"2",3,"0",9,"2",3,"0",12,"2",8,"0",20,"2",9,"0",14,"2",16,"0",7,"2",3,"0",10,"2",5,"0",53,"2",6,"0",9,"2",6,"0",6,"2",5,"0",7,"2",5,"0",10,"2",11,"0",17,"2",11,"0",13,"2",17,"0",5,"2",5,"0",9,"2",5,"0",53,"2",5,"0",8,"2",8,"0",5,"2",6,"0",7,"2",5,"0",10,"2",12,"0",15,"2",12,"0",13,"2",17,"0",5,"2",5,"0",9,"2",5,"0",53,"2",5,"0",6,"2",10,"0",5,"2",6,"0",7,"2",6,"0",8,"2",14,"0",12,"2",14,"0",12,"2",18,"0",5,"2",5,"0",9,"2",5,"0",53,"2",5,"0",4,"2",11,"0",6,"2",5,"0",8,"2",6,"0",8,"2",15,"0",10,"2",9,"0",1,"2",4,"0",13,"2",9,"0",2,"2",6,"0",6,"2",5,"0",9,"2",5,"0",53,"2",5,"0",1,"2",13,"0",7,"2",5,"0",9,"2",5,"0",7,"2",6,"0",3,"2",7,"0",10,"2",7,"0",20,"2",6,"0",16,"2",6,"0",9,"2",5,"0",53,"2",17,"0",9,"2",5,"0",9,"2",5,"0",7,"2",6,"0",5,"2",6,"0",8,"2",7,"0",2,"2",11,"0",8,"2",5,"0",17,"2",6,"0",9,"2",5,"0",53,"2",17
View game.txt
{"canvasIndex":10,"gameLink":"www.flickgame.org","canvasses":[[409,"f",6,"e",193,"f",9,"e",190,"f",11,"e",188,"f",7,"e",1,"f",4,"e",187,"f",7,"e",3,"f",4,"e",185,"f",7,"e",5,"f",3,"e",185,"f",15,"e",185,"f",15,"e",185,"f",14,"e",186,"f",6,"e",194,"f",6,"e",194,"f",6,"e",8,"f",2,"e",185,"f",7,"e",5,"f",4,"e",185,"f",15,"e",186,"f",13,"e",190,"f",8,"e",586,"f",2,"0",2,"f",2,"0",2,"f",3,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",2,"f",2,"0",1,"f",2,"0",1,"f",2,"0",4,"f",3,"0",5,"f",3,"0",158,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",3,"f",1,"0",2,"f",1,"0",1,"f",1,"0",3,"f",1,"0",3,"f",1,"0",1,"f",1,"0",1,"f",1,"0",160,"f",3,"0",1,"f",3,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",2,"f",1,"0",2,"f",2,"0",1,"f",3,"0",3,"f",2,"0",3,"f",1,"0",2,"f",2,"0",159,"f",1,"0",1,"f",1,"0",1,"f",2,"0",2,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",1,"f",1,"0",3,"f",1,"0",1,"f",1,"0",2,"f",2,"0",4,"f",1,"0",3,"f",1,"0",1,"f",1,"0",1,"
View game.txt
{"canvasIndex":0,"gameLink":"www.flickgame.org","canvasses":[[3886,"0",6,"b",193,"0",8,"b",165,"0",4,"b",22,"0",9,"b",164,"0",7,"b",19,"0",11,"b",122,"0",3,"b",37,"0",9,"b",18,"0",11,"b",121,"0",5,"b",35,"0",11,"b",16,"0",6,"b",1,"0",5,"b",121,"0",5,"b",19,"0",3,"b",13,"0",12,"b",14,"0",7,"b",1,"0",5,"b",121,"0",5,"b",18,"0",6,"b",10,"0",13,"b",12,"0",8,"b",2,"0",5,"b",121,"0",5,"b",17,"0",8,"b",8,"0",7,"b",2,"0",6,"b",10,"0",8,"b",3,"0",5,"b",121,"0",6,"b",14,"0",11,"b",7,"0",6,"b",3,"0",6,"b",9,"0",8,"b",4,"0",5,"b",121,"0",6,"b",13,"0",12,"b",7,"0",5,"b",4,"0",6,"b",8,"0",8,"b",5,"0",5,"b",122,"0",5,"b",12,"0",14,"b",7,"0",3,"b",5,"0",6,"b",7,"0",13,"b",1,"0",5,"b",1,"0",8,"b",113,"0",5,"b",11,"0",8,"b",1,"0",6,"b",14,"0",6,"b",8,"0",29,"b",112,"0",5,"b",10,"0",8,"b",3,"0",5,"b",13,"0",7,"b",8,"0",29,"b",112,"0",5,"b",9,"0",7,"b",5,"0",5,"b",12,"0",7,"b",9,"0",29,"b",112,"0",5,"b",9,"0",6,"b",6,"0",5,"b",10,"0",8,"b",11,"0",27,"b",113,"0",6,"b",8,"0",5,"b",7,"0",5,"b",8,"0",14,"b",17,"0",11,"b",119,"0",6,"
View game.txt
{"canvasIndex":0,"gameLink":"www.flickgame.org","canvasses":[[593,"f",1,"6",47,"f",10,"2",18,"f",2,"2",11,"f",1,"2",18,"f",2,"2",11,"f",6,"2",12,"f",2,"2",1,"f",3,"2",55,"f",1,"6",11,"f",13,"2",16,"f",1,"2",5,"f",12,"2",16,"f",4,"2",9,"f",3,"2",6,"f",1,"2",6,"f",7,"2",9,"f",8,"2",10,"f",10,"2",9,"f",1,"2",36,"f",1,"6",5,"f",1,"6",2,"f",1,"6",7,"f",15,"2",4,"f",1,"2",9,"f",3,"2",5,"f",10,"2",17,"f",5,"2",7,"f",4,"2",5,"f",3,"2",4,"f",9,"2",7,"f",10,"2",9,"f",11,"2",7,"f",6,"2",32,"f",1,"6",5,"f",1,"6",2,"f",1,"6",8,"f",13,"2",4,"f",3,"2",8,"f",3,"2",5,"f",3,"2",24,"f",5,"2",6,"f",5,"2",5,"f",3,"2",4,"f",5,"2",2,"f",3,"2",6,"f",3,"2",4,"f",3,"2",9,"f",3,"2",1,"f",1,"2",2,"f",4,"2",7,"f",8,"2",30,"f",1,"6",5,"f",1,"6",1,"f",1,"6",14,"f",4,"2",8,"f",3,"2",8,"f",3,"2",5,"f",3,"2",24,"f",6,"2",5,"f",5,"2",5,"f",3,"2",4,"f",3,"2",5,"f",3,"2",6,"f",3,"2",4,"f",3,"2",8,"f",3,"2",6,"f",3,"2",6,"f",9,"2",10,"f",1,"6",19,"f",1,"6",4,"f",1,"6",1,"f",1,"6",15,"f",3,"2",8,"f",3,"2",8,"f",3,"2",4,"f",3,"2",25,"f",6,"2",4,"f"
View game.txt
{"canvasIndex":0,"gameLink":"www.flickgame.org","canvasses":[[1149,"0",3,"3",196,"0",5,"3",194,"0",6,"3",193,"0",7,"3",144,"0",3,"b",45,"0",7,"3",144,"0",5,"b",43,"0",7,"3",145,"0",5,"b",43,"0",6,"3",146,"0",5,"b",42,"0",6,"3",135,"0",3,"b",9,"0",5,"b",41,"0",7,"3",134,"0",5,"b",7,"0",6,"b",11,"0",7,"b",22,"0",7,"3",135,"0",6,"b",6,"0",6,"b",10,"0",10,"b",19,"0",7,"3",136,"0",6,"b",6,"0",5,"b",10,"0",13,"b",16,"0",7,"3",138,"0",5,"b",6,"0",5,"b",10,"0",14,"b",14,"0",7,"3",139,"0",5,"b",6,"0",5,"b",9,"0",16,"b",12,"0",7,"3",100,"0",3,"b",37,"0",5,"b",6,"0",5,"b",8,"0",7,"b",1,"0",10,"b",11,"0",6,"3",100,"0",5,"b",35,"0",6,"b",6,"0",5,"b",7,"0",8,"b",4,"0",8,"b",9,"0",6,"3",85,"0",3,"b",13,"0",5,"b",35,"0",6,"b",6,"0",5,"b",7,"0",7,"b",7,"0",6,"b",8,"0",7,"3",84,"0",5,"b",12,"0",6,"b",34,"0",5,"b",6,"0",6,"b",7,"0",5,"b",10,"0",5,"b",8,"0",6,"3",85,"0",5,"b",12,"0",6,"b",15,"0",10,"b",9,"0",5,"b",6,"0",6,"b",7,"0",5,"b",10,"0",5,"b",8,"0",5,"3",86,"0",5,"b",13,"0",5,"b",13,"0",14,"b",7,"0",5,"b",6,"0",5,"b",8,"
@quietshu
quietshu / prepack-gentle-intro-1.md
Created May 25, 2018 — forked from gaearon/prepack-gentle-intro-1.md
A Gentle Introduction to Prepack, Part 1
View prepack-gentle-intro-1.md

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
You can’t perform that action at this time.