Skip to content

Instantly share code, notes, and snippets.

View yysun's full-sized avatar
💭
Working on AppRun

Yiyi Sun yysun

💭
Working on AppRun
View GitHub Profile
@yysun
yysun / index.html
Created December 17, 2020 18:03
Compile TypeScript in the browser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/typescript@latest/lib/typescriptServices.js"></script>
<script src="https://unpkg.com/apprun"></script>
<script src="my-tsc.js" defer></script>
</head>
<body>
@yysun
yysun / main.ts
Created November 14, 2016 13:02
TypeScript async/await example
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
const main = async () => {
console.log("Hello");
for (let i = 0; i < 3; i++) {
await delay(500);
console.log(".");
}
console.log("World!");
}
@yysun
yysun / index.html
Created September 29, 2013 17:19
HTML5
<!DOCTYPE html>
<html>
<head>
<title>网页标题</title>
</head>
<body>
网页内容
</body>
</html>