Skip to content

Instantly share code, notes, and snippets.

Avatar

laobubu

View GitHub Profile
@laobubu
laobubu / ABOUT.md
Last active Apr 10, 2020
njq (No jQuery) use vanilla DOM API with jQuery-like functions.
View ABOUT.md

njq (No jQuery)

Vanilla JavaScript is good but the function names are too long. Now, you can use vanilla DOM API with jQuery-like functions.

Only ~1kB (without gzip) after uglifying. You can even tailor for yourself to make it much smaller, by deleting/adding modules. A good choice to manipulate DOM for side projects.

Document

View 去你大爷的 CSDN 全文阅读.user.js
// ==UserScript==
// @name 去你大爷的 CSDN 全文阅读
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 把登录后查看全文阅读的那个啥玩意儿给干掉
// @author laobubu
// @match http://blog.csdn.net/*/article/details/*
// @grant none
// ==/UserScript==
@laobubu
laobubu / @Stupid-CAPTCHA-OCR.md
Last active Apr 7, 2019
Stupid CAPTCHA OCR written in 1 hour
View @Stupid-CAPTCHA-OCR.md

一个超级简单的验证码识别。据说准确率比深度学习还要高哦(ε=ε=ε=┏(゜v゜;)┛

依赖:pip install Pillow

来源是 V2EX 上被喷惨的帖子: https://www.v2ex.com/t/354318

Author: laobubu

(纯粹个人兴趣掐着表写的,没收钱。一个小时内写完。PIL 的文档真难看。)

@laobubu
laobubu / hypermd-v2ex.js
Last active Mar 5, 2019
HyperMD for V2EX
View hypermd-v2ex.js
/**
HyperMD breaks the wall between Preview and Writing for Markdown.
@see https://github.com/laobubu/HyperMD/
此脚本可以帮助你在 V2EX 发帖界面体验 HyperMD 的强大功能。
使用方法:
1. 打开发帖界面 https://www.v2ex.com/new
2. 在地址栏输入以下地址并回车 [^1]
@laobubu
laobubu / ABOUT.md
Last active Feb 15, 2021
A very simple HTTP server in C, for Unix, using fork()
View ABOUT.md

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@laobubu
laobubu / lite-server-plus.js
Last active Mar 19, 2020
A Enhanced lite-server tool with sass watching
View lite-server-plus.js
/**
Enhanced lite-server tool with sass watching.
## What it does
0. run `lite-server`
1. watch `scss/*.scss` and compile into `style/*.css`
## How to use
@laobubu
laobubu / typecho-to-jekyll-and-duoshuo.js
Last active May 21, 2018
Convert Typecho to Jekyll & DuoShuo
View typecho-to-jekyll-and-duoshuo.js
/**
* Typecho to Jekyll & DuoShuo
*
* @author laobubu.net
*
* Usage:
* 1. run `npm install dateformat`
* 2. export table `typecho_comments` and `typecho_contents` as two json files. you can do this with PHPMySQLAdmin
* 3. edit this file, especially line 15 - 20
* 4. run `node t2jd.js`
@laobubu
laobubu / wordpress2jekyll.js
Created Jan 4, 2016
Convert WordPress exported XML to Jekyll Posts
View wordpress2jekyll.js
var parseString = require('xml2js').parseString;
var fs = require("fs");
var path = require("path");
var targetPath = "/home/laobubu/jekyll/_posts";
var wpXMLFile = "wordpress.xml";
try {
fs.mkdirSync(targetPath);
} catch (er){}
@laobubu
laobubu / personal_setup.sh
Last active Jul 13, 2016
Customize a newly-installed Ubuntu, easily.
View personal_setup.sh
#!/bin/bash
#-----------------------------------------
# Personal PC Setup
#-----------------------------------------
# Warning:
# Modify this script to make it work for you properly.
# The author makes no warranty or guarantee.
#-----------------------------------------
# What does this do
# - Install `apt-fast screen aria2c`