Skip to content

Instantly share code, notes, and snippets.

View kiinlam's full-sized avatar
:octocat:
hard working

kiinlam kiinlam

:octocat:
hard working
View GitHub Profile
@afc163
afc163 / cascader-address-options.js
Last active July 22, 2024 05:43
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,
@kiinlam
kiinlam / index.html
Last active August 29, 2015 14:14 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var w = 960,
h = 500,
nodes = [],
node;

Circles, text and getImageData

I'm back with more of them moving circles. This script uses getImageData to form the text with particles. You can do some fun stuff with text and Canvas this way. Once again I'm using createjs for Canvas manipulation and the greensock library for easy tweening.

Forked from Rachel Smith's Pen Circles, text and getImageData.

A Pen by Captain Anonymous on CodePen.

License.

@Hosuke
Hosuke / setGit.md
Last active August 29, 2015 14:07
Setting Up Git Workspace

####Restart Git Bash or your terminal

Once you’ve completed the following instructions, you'll need to close and re-open Git Bash (if you are using Windows) or your terminal (if you are using Mac or Linux). Many of the configurations listed here will not take place until you have done this, so if you don’t see your changes taking place right away, this is probably why.

####Downloading necessary files

Later in these instructions, you'll need the two files git-completion.bash and git-prompt.sh. To download them:

  • Visit this page, where you can find git-completion.bash.
  • Right click anywhere on the page and select "Save As..."
@Liner-z
Liner-z / msysgit_use_chinese
Created April 8, 2014 16:33
windows下git bash显示中文
1、C:\Program Files\Git\etc\git-completion.bash:
alias ls='ls --show-control-chars --color=auto'
说明:使得在 Git Bash 中输入 ls 命令,可以正常显示中文文件名。
2、C:\Program Files\Git\etc\inputrc:
set output-meta on
@justjavac
justjavac / img2txt.js
Last active December 9, 2021 06:46
img2txt:基于canvas的图片转字符画工具
var cv = document.getElementById('cv');
var c = cv.getContext('2d');
var txtDiv = document.getElementById('txt');
var fileBtn = document.getElementById("up-button");
var img = new Image();
img.src = 'a.jpg';
img.onload = init; // 图片加载完开始转换
fileBtn.onchange = getImg;
// 根据灰度生成相应字符
@atk
atk / ie10hack.css
Created November 6, 2012 14:43
IE10 hack
/*
#ie10 will only be red in MSIE 10,
both in high contrast (display setting) and default mode
*/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#ie10 { color: red; }
}
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/