Skip to content

Instantly share code, notes, and snippets.

@WunGCQ
WunGCQ / top-20-npm-versions.js
Last active May 17, 2023 15:01
top-20-npm-versions.js
// ==UserScript==
// @name npm-top-version-list
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author wungcq
// @match https://www.npmjs.com/package/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=npmjs.com
// @grant none
// @require https://code.jquery.com/jquery-3.7.0.slim.min.js
@WunGCQ
WunGCQ / loot_rare_list_v0.4.js
Last active September 5, 2021 10:45
loot rare list v0.4
// ==UserScript==
// @name LootRare
// @namespace http://tampermonkey.net/
// @version 0.40
// @description Help you choose Loot Bag
// @author dashuo
// @match https://opensea.io/collection/lootproject
// @match https://opensea.io/assets/lootproject?*
// @match https://opensea.io/collection/lootproject?*
// @icon https://www.google.com/s2/favicons?domain=opensea.io
@WunGCQ
WunGCQ / vue-ts-config.d.ts
Last active January 14, 2019 17:31
the vue cli 3 vue.config.js defination according to document
import { Configuration as IWbpkConf } from "webpack";
import WebpackChain from "webpack-chain";
import { TransformOptions } from "babel-core";
import { Linter } from "eslint";
import ts from "typescript";
export interface IVueCliConfig {
baseUrl?: string;
publicPath?: string;
outputDir?: string;
@WunGCQ
WunGCQ / npm.taobao.sh
Last active January 15, 2023 17:52 — forked from 52cik/npm.taobao.sh
npm 淘宝镜像配置
npm set registry https://registry.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像
@WunGCQ
WunGCQ / not cache jump script
Created August 14, 2018 04:09
url cache jump
<script>
(function(){
function getQuery(r){var n=r||window.location.search;try{return(n?n.slice(1).split("&"):[]).reduce(function(r,n){var t=n.split("=");return r[t[0]||""]=t[1]||"",r},{})}catch(r){return{}}}
function stringifyQuery(r){var n=[];for(var t in r)n.push(t+"="+r[t]);return"?"+n.join("&")}
!function(){var o=getQuery(),n=Math.floor(Date.now()/12e4);if(o.tpv!=n){o.tpv=n;var i=window.location.origin+window.location.pathname+stringifyQuery(o)+window.location.hash;window.location.href=i}}();
})();
</script>
@WunGCQ
WunGCQ / share.js
Last active May 31, 2018 16:37
pigee_h5_share
function initShare() {
var wx = window['wx'];
var path = 'https://pigee.tongpaostudio.com/entry' + (childrenVersion ? '1' : '') + '?v=' + Date.now();
$.post('//api.tongpaostudio.com/api/js/config', {
url: window.location.href,
origin: path,
}, function (data) {
wx && wx.config(data);
wx && wx.ready(function () {
wx.onMenuShareTimeline({
@WunGCQ
WunGCQ / example.js
Created March 22, 2018 08:10
MYSQL: sequelize attribute alias for query JSON field
/*
when querying attributes using alias like:
attributes: [['m','n']] // to show m as n
sequelize will wrap the field word width '`'
the query will looks like `m` AS `n`
this seems simple;
but when query JSON fields:
//my data column: data, value: {name:'wungcq'}
attributes: ["data->'$.name'","name"]
@WunGCQ
WunGCQ / set100VH.js
Last active February 13, 2018 02:57
calculate 100vh to window.innerHeight to prevent keyboard squeeze window height on mobile
export function resetVH(){
const vh100 = window.innerHeight;
const styleContent = `
.vh-100 {
height: ${vh100}px;
}
`;
const node = document.createElement('style');
node.type = 'text/css';
node.innerHTML = styleContent;
@WunGCQ
WunGCQ / request.js
Created November 30, 2017 19:08
my axios
import Axios from 'axios';
import {
isArray
} from 'lodash';
import qs from 'qs';
const CGI_SERVER = process.env.CGI_SERVER;
export const cgiServerPath = () => CGI_SERVER;
const postConfig = {
method: 'POST',
@WunGCQ
WunGCQ / antd_lib_input_Textarea.d.ts
Created August 2, 2017 09:18
fix antd/lib/input/Textarea.d.ts (version 2.12.3)
/// <reference types="react" />
import React from 'react';
import { AbstractInputProps } from './Input';
export interface AutoSizeType {
minRows?: number;
maxRows?: number;
}
export interface TextAreaProps extends AbstractInputProps {
autosize?: boolean | AutoSizeType;
onPressEnter?: React.FormEventHandler<any>;