|
Description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TypeScript 21 hrs 47 mins ████████████████▒░░░ 67.1% | |
| Vue.js 6 hrs 21 mins ██████▓░░░░░░░░░░░░░ 19.6% | |
| JSON 2 hrs 10 mins ████▒░░░░░░░░░░░░░░░ 6.7% | |
| JavaScript 46 mins ███▒░░░░░░░░░░░░░░░░ 2.4% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function download(data, filename, type) { | |
| var a = document.createElement('a') | |
| var file = new Blob([data], { type: type }) | |
| if (window.navigator.msSaveOrOpenBlob) // IE10+ | |
| window.navigator.msSaveOrOpenBlob(file, filename) | |
| else { // Others | |
| var url = URL.createObjectURL(file) | |
| a.href = url | |
| a.download = filename | |
| document.body.appendChild(a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get_style( dom ) { | |
| var style; | |
| var returns = {}; | |
| // FireFox and Chrome way | |
| if(window.getComputedStyle){ | |
| style = window.getComputedStyle(dom, null); | |
| for(var i = 0, l = style.length; i < l; i++){ | |
| var prop = style[i]; | |
| var val = style.getPropertyValue(prop); | |
| returns[prop] = val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "basics": { | |
| "name": "Anthony Fu", | |
| "picture": "https://antfu.me/avatar.png", | |
| "label": "Software Engineer", | |
| "headline": "A ship in harbor is safe, but that is not what ships are built for.", | |
| "summary": "My name is Anthony Fu, a master of computer science student and a freelance software engineer. My passion for software lies with dreaming up ideas and making them come true with elegant interfaces. I take great care in the experience, architecture, and code quality of the things I build.\n\nI am also an open-source enthusiast and maintainer. I love how collaboration and knowledge sharing happens through open-source and I am happy to see what I do could eventually feedback to the community and industry.", | |
| "website": "https://antfu.me", | |
| "address": "", | |
| "projects_url": "https://antfu.me/projects", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import puppeteer from 'puppeteer' | |
| import fs from 'fs' | |
| async function buildPDF(htmlString) { | |
| const browser = await puppeteer.launch({ headless: true }) | |
| const page = await browser.newPage(); | |
| await page.setContent(htmlString, { waitUntil: 'networkidle0' }) | |
| const pdf = await page.pdf({ | |
| format: 'A4', | |
| displayHeaderFooter: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type GetComponentProps<T> = T extends React.ComponentType<infer P> | |
| ? P | |
| : T extends (props: any) => any | |
| ? Parameters<T> | |
| : never; | |
| class ClassComponent extends React.Component<{ a: number }> { | |
| render() { | |
| return <div />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.requestAnimationFrame = (function () { | |
| return window.requestAnimationFrame || | |
| window.webkitRequestAnimationFrame || | |
| window.mozRequestAnimationFrame || | |
| window.oRequestAnimationFrame || | |
| window.msRequestAnimationFrame || | |
| function (callback) { | |
| window.setTimeout(callback, 1000 / 60); | |
| }; | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dotenv/config' | |
| import { Octokit } from '@octokit/core' | |
| const org = process.env.SPONSORS_ORG! | |
| const token = process.env.SPONSORS_TOKEN! | |
| const octokit = new Octokit({ auth: token }) | |
| const allMembers = await fetchMembers(org) | |
| const membersWithoutTeam = new Set(allMembers.map(m => m.login)) |
NewerOlder