Skip to content

Instantly share code, notes, and snippets.

View magicdawn's full-sized avatar
🐟
Fishing

Tao magicdawn

🐟
Fishing
View GitHub Profile
@magicdawn
magicdawn / Microsoft YaHei.css
Created September 13, 2014 11:58
微软雅黑,重定向字体版
/*
* 代码整理自 百度贴吧-chrome吧 @晓风残破
* http://tieba.baidu.com/p/3285731258
*
*/
*{
text-shadow: silver 0px 0px 1px;
}
@magicdawn
magicdawn / vscode-big-clock.less
Last active April 9, 2022 02:35
vscode-big-clock
#rid9\.datetime {
position: fixed;
top: 85px;
right: 105px;
font-size: 75px;
color: red;
line-height: 1.4 !important;
height: unset !important;
font-family: 'M+ 1m', 'Hack';
@magicdawn
magicdawn / ascii-logo-for-cli.js
Created January 1, 2021 18:26
ascii logo for cli
const gradient = require('gradient-string')
const figlet = require('figlet')
console.log(
gradient.rainbow(
figlet.textSync('Hello World !', {
font: 'Standard',
horizontalLayout: 'full',
})
)
@magicdawn
magicdawn / collision.js
Last active September 8, 2018 02:43
stable collison detect use in mapbox symbol layer
/**
* 初始的 filter
*/
export function initialFilter({ map, list }) {
list.forEach(item => setBox({ map, item }))
let i = 0
while (i < list.length) {
let prev = list.slice(0, i)
@magicdawn
magicdawn / tieba.py
Created September 11, 2014 14:30
tieba image downloader python3 version
#beautiful soup doc : http://www.crummy.com/software/BeautifulSoup/bs4/doc/index.zh.html
DEBUG = False #是否在调试
EXAMPLE_URL = 'http://tieba.baidu.com/p/3287469841' #示例网址
PAGE_ENCODING = "gbk" #返回的encoding,默认就好
IMAGE_DIR = 'image' #存放目录
def getTitle(soup): #获取标题,文件夹名
title = (soup.select("h1.core_title_txt"))[0]['title']
return title.strip()
def getImgSrcs(soup): #如何获取本页的img src
@magicdawn
magicdawn / yargs.js
Last active July 19, 2017 13:15
yargs
const i = yargs
.usage('$0 -u <url> [options]')
.option('url', {
alias: 'u',
describe: '专辑/歌单 url',
required: true,
type: 'string',
})
.option('concurrency', {
alias: 'c',
@magicdawn
magicdawn / ImageCaptcha.js
Created November 21, 2016 14:21
image captcha with node-gd
'use strict'
const fs = require('fs')
const _ = require('lodash')
const onecolor = require('onecolor')
const gd = require('node-gd')
// https://github.com/y-a-v-a/node-gd/blob/master/docs/index.md
// Set full path to font file
const fontpath = __home + '/files/fonts/arial.ttf'
@magicdawn
magicdawn / python-img-downloader.py
Last active April 21, 2017 10:00
python-img-downloader
# encoding:utf-8
#################################################################################
#自定义区
#beautiful soup doc : http://www.crummy.com/software/BeautifulSoup/bs4/doc/index.zh.html
#################################################################################
DEBUG = False #是否在调试
EXAMPLE_URL = 'http://www.baidu.com' #示例网址
HTML_ENCODING =None #返回的encoding,默认就好
IMAGE_DIR = 'image' #存放目录
@magicdawn
magicdawn / huaban-board-downloader.py
Last active August 11, 2016 02:21
huaban-board-downloader
# encoding:utf-8
#################################################################################
#自定义区
#beautiful soup doc : http://www.crummy.com/software/BeautifulSoup/bs4/doc/index.zh.html
#################################################################################
DEBUG = False #是否在调试
EXAMPLE_URL = 'http://huaban.com/boards/2904887/' #示例网址
HTML_ENCODING = 'utf8' #返回的encoding,默认就好
IMAGE_DIR = 'image' #存放目录