Skip to content

Instantly share code, notes, and snippets.

View laobubu's full-sized avatar

laobubu

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

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

// ==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 April 7, 2019 15:15
Stupid CAPTCHA OCR written in 1 hour

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

依赖:pip install Pillow

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

Author: laobubu

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

@laobubu
laobubu / hypermd-v2ex.js
Last active March 5, 2019 06:55
HyperMD for V2EX
/**
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 March 23, 2024 05:28
A very simple HTTP server in C, for Unix, using fork()

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 March 19, 2020 13:26
A Enhanced lite-server tool with sass watching
/**
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 08:16
Convert Typecho to Jekyll & DuoShuo
/**
* 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 January 4, 2016 14:00
Convert WordPress exported XML to Jekyll Posts
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 July 13, 2016 16:25
Customize a newly-installed Ubuntu, easily.
#!/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`