Skip to content

Instantly share code, notes, and snippets.

View bigshans's full-sized avatar
🐶
Doge

Algernon bigshans

🐶
Doge
View GitHub Profile
@bigshans
bigshans / main.py
Created June 10, 2024 06:42
py-pdfbookmark
import PyPDF2
import sys
class PdfDirGenerator:
def __init__(self, pdf_path:str, txt_path:str, offset:int, out_path:str=None, levelmark:str='.'):
self.pdf_path = pdf_path # pdf路径
self.txt_path = txt_path # 包含pdf目录信息的txt
self.offset = offset # 目录页数偏移量
@bigshans
bigshans / electron.main.js
Last active June 15, 2023 02:17
Single file to lauch something
// lauch a web page in electron
const { app, BrowserWindow } = require("electron");
const url = require("url");
const fs = require("fs");
const http = require("http");
const path = require("path");
const Readable = require("stream").Readable;
const BASE_PORT = 8000;
let port = BASE_PORT;
@bigshans
bigshans / verticalTabPane.uc.js
Last active March 10, 2023 17:23
Vertical tab pane for firefox, look like edge
// ==UserScript==
// @name Vertical Tabs Pane
// @version 1.6.9
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Create a vertical pane across from the sidebar that functions
// like the vertical tab pane in Microsoft Edge. It doesn't hide the tab bar
// since people have different preferences on how to do that, but it sets an
// attribute on the root element that you can use to hide the regular tab bar
// while the vertical pane is open, for example :root[vertical-tabs]
@bigshans
bigshans / 99-noto-mono-color-emoji.conf
Created September 4, 2022 12:44 — forked from IgnoredAmbience/99-noto-mono-color-emoji.conf
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
// ==UserScript==
// @name salf.uc.js
// @include main
// @version 3.4
// @note github.com/thepante
// ==/UserScript==
/* - - - - - - - - - - - SETTINGS - - - - - - - - - - - - - - - */
const float_mode = {
#!/bin/bash
URL="https://wttr.in/"
URLv2="https://v2.wttr.in/"
URLv3="https://v3.wttr.in/"
Help()
{
echo -e "
Write 'wttr {your+city+name}' to check the weather condition of your city.
export class BigDecimal {
DECIMALS: number;
ROUNDED: boolean;
SHIFT: BigInt;
_n: BigInt;
constructor(value: number | string | BigDecimal | BigInt);
static fromBigInt(bigint: BigInt): BigDecimal;
add(num: number | string | BigDecimal | BigInt): BigDecimal;
substract(num: number | string | BigDecimal | BigInt): BigDecimal;
static _divRound(dividend: BigInt, divisor: BigInt): BigDecimal;
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();
@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
@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;