Skip to content

Instantly share code, notes, and snippets.

View afc163's full-sized avatar
🎃
Closing issues

afc163 afc163

🎃
Closing issues
View GitHub Profile
// 当前的 Generator
var activeGenerator;
// 控制工具
function start(generatorFunc) {
activeGenerator = generatorFunc(function(data) {
activeGenerator.next(data);
});
activeGenerator.next();
}
@afc163
afc163 / glovar
Last active December 21, 2015 21:09
Find the new global variable.
(function() {
// save global scope
var scope = [];
for(var p in window) {
scope.push(p);
}
// code
window.a = 1;
@afc163
afc163 / aliway_script
Last active December 26, 2015 07:28 — forked from sorrycc/aliway_script
// ==UserScript==
// @name AliWay Script.
// @version 0.1
// @match http://www.aliway.com/*
// @copyright 2012+, You
// ==/UserScript==
$("div.tpc_content").removeClass("tpc_content").css("padding", "0 15px 20px 15px").css("line-height", "1.5");
document.body.style.webkitUserSelect = "text";
document.body.style.MozUserSelect = "text";
import styles from './Count.module.less';
import React from 'react';
import classnames from 'classnames';
import { Button } from 'antd';
import { COUNT_INCREASE, COUNT_INCREASE_ASYNC, COUNT_DECREASE } from '../../constants/count';
const Count = ({ dispatch, count }) =>
<div>
<div>{count}</div>
<Button
@afc163
afc163 / Stylefile.yml
Created July 30, 2018 09:45
Customizations for www.yuque.com via StyleURL.
---
version: 1.0
domains:
- www.yuque.com
url_patterns:
- www.yuque.com/*
timestamp: '2018-07-30T09:44:20Z'
id: 5SbQ
redirect_url: https://www.yuque.com/
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["@antv/g2"], factory);
} else if (typeof exports !== "undefined") {
factory(require("@antv/g2"));
} else {
var mod = {
exports: {}
};
factory(global.g2);
@afc163
afc163 / cascader-address-options.js
Last active December 14, 2023 01:47
Address options for antd cascader
import provinces from 'china-division/dist/provinces.json';
import cities from 'china-division/dist/cities.json';
import areas from 'china-division/dist/areas.json';
areas.forEach((area) => {
const matchCity = cities.filter(city => city.code === area.cityCode)[0];
if (matchCity) {
matchCity.children = matchCity.children || [];
matchCity.children.push({
label: area.name,