Skip to content

Instantly share code, notes, and snippets.

View bigshans's full-sized avatar
🐶
Doge

Algernon bigshans

🐶
Doge
View GitHub Profile
#!/usr/bin/python3
#coding:utf-8
from lxml import etree
import urllib.request
import os
import threading
import re
import sys
@bigshans
bigshans / bilibili 番剧更新标签
Last active October 3, 2018 09:14
bilibili_season_update.user.js
// ==UserScript==
// @name bilibili 首页番剧更新
// @namespace http://tampermonkey.net/
// @version 0.2.0
// @description try to take over the world!
// @author Bigshans
// @match https://www.bilibili.com/
// @grant GM_xmlhttpRequest
// ==/UserScript==
// ==UserScript==
// @name bilibili click
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 链接可点击
// @author Bigshans
// @match https://h.bilibili.com/*
// @match https://t.bilibili.com/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name bilibili 评论区可点击
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author BigShans
// @match https://h.bilibili.com/*
// @match https://t.bilibili.com/*
// @grant none
// ==/UserScript==
@bigshans
bigshans / README-Template.md
Created January 26, 2019 10:10 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@bigshans
bigshans / lisp.py
Created May 24, 2019 12:40
A simple lisp adder interpreter.
#!/usr/bin/python3
class Tokenize:
def __init__(self, context):
self.context = context.replace('(', ' ( ').replace(')', ' ) ').split()
self.top = -1
def getNextToken(self):
self.top += 1
if self.top < len(self.context):
return self.context[self.top]
@bigshans
bigshans / formatTime.ts
Last active July 22, 2021 07:08
ts/js utils code
function formatTime(time: Date|number|string, format: string = 'YY-MM-DD hh:mm:ss'): string {
if (!time) {
return '';
}
let date: Date;
if (typeof time === 'number') {
date = new Date(time);
} else if (typeof time === 'string') {
if (/^\d+$/g.test(time)) {
date = new Date(+time);
@bigshans
bigshans / css-tricks__collection.less
Last active January 8, 2022 08:27
Some css trcicks code record.
/* 当文本内容长度超过容器最大宽度时,自动省略多余的文本。 */
/* When the text content length exceeds the maximum container width,
* the excess text is automatically omitted. */
.line-clamp(@line) {
display: -webkit-box;
-webkit-line-clamp: @line;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;
@bigshans
bigshans / whoogle-open-link-in-new-tab.user.js
Last active June 10, 2022 08:34
whoogle-open-link-in-new-tab.user.js
Number.prototype.toFixed = function (n) {
if (n > 20 || n < 0) {
throw new RangeError('toFixed() digits argument must be between 0 and 20');
}
const number = this;
if (isNaN(number) || number >= Math.pow(10, 21)) {
return number.toString();
}
if (typeof (n) == 'undefined' || n == 0) {
return (Math.round(number)).toString();