This file contains 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 26 hrs 14 mins ███████████████████▍░ 92.7% | |
JSON 1 hr 12 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.3% | |
JavaScript 41 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.5% | |
tsconfig 5 mins ░░░░░░░░░░░░░░░░░░░░░ 0.3% | |
GitIgno... 1 min ░░░░░░░░░░░░░░░░░░░░░ 0.1% |
This file contains 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
// ==UserScript== | |
// @name 托福考位查询增强 | |
// @namespace https://github.com/exuanbo | |
// @version 2.0.1 | |
// @author Exuanbo | |
// @description 一键查询所选地点所有时间的可预定考位 | |
// @icon https://raw.githubusercontent.com/exuanbo/toefl-query-seats-enhance/master/src/img/icon48.png | |
// @updateURL https://gist.github.com/exuanbo/32ebda63925b60e7817ba0346b980d14/raw/toefl-query-seats-enhance.user.js | |
// @downloadURL https://gist.github.com/exuanbo/32ebda63925b60e7817ba0346b980d14/raw/toefl-query-seats-enhance.user.js | |
// @match https://toefl.neea.cn/myHome/* |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
// https://stackoverflow.com/a/34152244/13346012 | |
export const hasSubArray = <T>(master: T[], sub: T[]): boolean => | |
sub.every( | |
((index: number) => (value: T) => | |
(index = master.indexOf(value, index) + 1))(0) | |
) |
This file contains 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
// https://stackoverflow.com/a/14810722/13346012 | |
export const objectMap = <T, V>( | |
obj: T, | |
fn: (key: string, value: any) => [string, V] | |
): { [k: string]: V } => | |
Object.fromEntries(Object.entries(obj).map(([k, v]) => fn(k, v))) |
This file contains 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
a { | |
background-image: linear-gradient(120deg, #fc0 0%, #fc0 100%); | |
background-position: 0 100%; | |
background-repeat: no-repeat; | |
background-size: 100% 0; | |
border-bottom: 2px solid #fc0; | |
text-decoration: none; | |
transition: background-size .125s ease-in; | |
} |
This file contains 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
export const throttle = (fn: any, timeFrame: number) => { | |
let lastTime = 0 | |
return () => { | |
const now = Date.now() | |
if (now - lastTime >= timeFrame) { | |
fn() | |
lastTime = now | |
} | |
} | |
} |
This file contains 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
# https://stackoverflow.com/a/55445034/13346012 | |
brew leaves | xargs brew deps --installed --for-each | sed "s/^.*:/$(tput setaf 4)&$(tput sgr0)/" |
This file contains 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 { ESLint } from 'eslint'; | |
declare type CLIOptions = Partial<{ | |
[key in 'cmd' | 'version' | 'tagline' | 'bugs' | 'homepage']: string; | |
}>; | |
declare type ProvidedESLintOptions = Omit<ESLint.Options, 'cwd' | 'resolvePluginsRelativeTo'>; | |
interface ProvidedOptions extends CLIOptions { | |
[key: string]: unknown; | |
ESLint: typeof ESLint; | |
eslintOptions?: Partial<ProvidedESLintOptions>; |
This file contains 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
const excludeUndefined = <T>(item: T | undefined): item is T => | |
item !== undefined | |
export default excludeUndefined |
OlderNewer