Skip to content

Instantly share code, notes, and snippets.

😳
😳

Peng Xiao pengx17

😳
😳
Block or report user

Report or block pengx17

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 riphook.ts
import React, { useMemo, useEffect } from 'react';
type Func<Args extends any[], Return> = (...args: Args) => Return;
/**
* Wrap a hook and return a component
*/
export function ripook<Args extends any[], Return>(hook: Func<Args, Return>) {
const RipookWrapper: React.FC<{
params: Args;
View 肖富贵起名器.ts
import { request } from 'gaxios';
import * as cheerio from 'cheerio';
import { promises } from 'fs';
const base = 'http://v.8s8s.com';
async function getNameList(): Promise<[string, string][]> {
const page = await request<string>({
url: base + '/qumingzi_5.php',
View _definitions.json
{
"definitions": {
"io.k8s.kubernetes.pkg.api.v1.NodeDaemonEndpoints": {
"description": "NodeDaemonEndpoints lists ports opened by daemons running on the Node.",
"properties": {
"kubeletEndpoint": {
"$ref": "#/definitions/io.k8s.kubernetes.pkg.api.v1.DaemonEndpoint",
"description": "Endpoint on which Kubelet is listening."
}
},
@pengx17
pengx17 / kubernetes-schema-all.json
Last active Nov 15, 2018
kubernetes-schema-all.json
View kubernetes-schema-all.json
{
"oneOf": [
{
"$ref": "https://gist.githubusercontent.com/pengx17/0ce785e18739f3421c95ee7bf833e37f/raw/ac3783b7416196309eabb46c846748e6043c9060/_definitions.json#/definitions/io.k8s.kubernetes.pkg.apis.authorization.v1.NonResourceAttributes"
},
{
"$ref": "https://gist.githubusercontent.com/pengx17/0ce785e18739f3421c95ee7bf833e37f/raw/ac3783b7416196309eabb46c846748e6043c9060/_definitions.json#/definitions/com.github.openshift.origin.pkg.image.apis.image.v1.ImageStreamList"
},
{
"$ref": "https://gist.githubusercontent.com/pengx17/0ce785e18739f3421c95ee7bf833e37f/raw/ac3783b7416196309eabb46c846748e6043c9060/_definitions.json#/definitions/io.k8s.kubernetes.pkg.api.v1.AzureDiskVolumeSource"
View app-nav-config-category.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://gist.githubusercontent.com/pengx17/bba5e7d5b25fcdd143673cb0df9c0b93/raw/ad8bec658dcc44904cf908acc5a525148f7ad4ec/app-nav-config-category.json",
"type": "object",
"title": "Rubick App Nav Config",
"required": [
"user"
],
"properties": {
"user": {
View gist:6b74522c545105a97bac2661c1a62b84
const { get, post } = require("axios");
const url = `https://sc.ftqq.com/SCU15511Ta62845f53fed1f23c365071e0e1bda035a029f383eba8.send`;
const getParams = (text, desp) => encodeURI(`?text=${text}&desp=${desp}`);
async function getBeijingStores() {
const res = await get(
"https://reserve-prime.apple.com/CN/zh_CN/reserve/iPhone/stores.json"
);
@pengx17
pengx17 / debounce-promise.js
Last active Apr 15, 2017
Like lodash.debounce, but multiple calls to a debounced function will return the same promise so that they will be notified when the debounced function returns.
View debounce-promise.js
// Debounced promise:
// Like lodash.debounce, but multiple calls to a debounced function
// will return the same promise so that they will be notified when the debounced function returns
//
// In case the deboucned value is a promise, the last promise value shall be returned.
function debounceFn(fn, timeout) {
let timer = undefined;
let resPromise = undefined;
let resolver = undefined;
let rejector = undefined;
@pengx17
pengx17 / markdown_here.css
Last active Dec 19, 2015
My customized Markdown Here Styling
View markdown_here.css
/*
* NOTE:
* - The use of browser-specific styles (-moz-, -webkit-) should be avoided.
* If used, they may not render correctly for people reading the email in
* a different browser than the one from which the email was sent.
* - The use of state-dependent styles (like a:hover) don't work because they
* don't match at the time the styles are made explicit. (In email, styles
* must be explicitly applied to all elements -- stylesheets get stripped.)
*/
You can’t perform that action at this time.