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 apidoc json to typescript definition | |
// @namespace Violentmonkey Scripts | |
// @match https://t.onramplab.com/docs* | |
// @grant none | |
// @version 1.01 | |
// @author [email protected] | |
// @description apidoc json generate to tsd | |
// ==/UserScript== | |
{ |
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 { useState, Dispatch, SetStateAction, useMemo } from 'react'; | |
const reactiveKeys = ['add', 'clear', 'delete']; | |
const reactive = <K>(set: Set<K>, setSet: Dispatch<SetStateAction<Set<K>>>) => { | |
const _proxy = Proxy.revocable(set, { | |
get(target, value: keyof Set<K>) { | |
if (reactiveKeys.includes(value)) { | |
return (arg: K) => { | |
target[value as 'add' | 'clear' | 'delete'].bind(target)(arg); |
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 { useState, useMemo, useCallback } from 'react'; | |
interface StableActions<K> { | |
add: (key: K) => void; | |
remove: (key: K) => void; | |
reset: () => void; | |
} | |
interface Actions<K> extends StableActions<K> { | |
has: (key: K) => boolean; |
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 New script - github.com | |
// @namespace Violentmonkey Scripts | |
// @match https://github.com/* | |
// @grant none | |
// @version 1.0 | |
// @author [email protected] | |
// @description 12/9/2019, 5:20:26 PM | |
// ==/UserScript== | |
if (document.querySelector('#readme article')) { |
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 path = require('path') | |
const ImageminPlugin = require('imagemin-webpack-plugin').default | |
function resolve (dir) { | |
return path.join(__dirname, dir) | |
} | |
let externals = {} | |
let plugins = [] | |
if (process.env.NODE_ENV === 'production') { | |
// 外部有引入cdn的話 | |
externals = { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<style> | |
.card { |
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
{ | |
"link": { | |
"self": { | |
"href": "/order" | |
}, | |
"cancel": { | |
"method": "delete", | |
"href": "/order/cancel/{id}" | |
}, | |
"change": { |
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
// <![CDATA[ <-- For SVG support | |
if ('WebSocket' in window) { | |
(function () { | |
function refreshCSS () { | |
var sheets = [].slice.call(document.getElementsByTagName("link")); | |
var head = document.getElementsByTagName("head")[0]; | |
for (var i = 0; i < sheets.length; ++i) { | |
var elem = sheets[i]; | |
head.removeChild(elem); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
<style> | |
#nav-check { | |
display: none; |
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
function sequenceTasks(tasks) { | |
function recordValue(results, value) { | |
results.push(value); | |
return results; | |
} | |
var pushValue = recordValue.bind(null, []); | |
return tasks.reduce(function (promise, task) { | |
return promise.then(task).then(pushValue); | |
}, Promise.resolve()); | |
} |
NewerOlder