Skip to content

Instantly share code, notes, and snippets.

View RustingSword's full-sized avatar
🤦‍♂️

RustingSword

🤦‍♂️
View GitHub Profile
@RustingSword
RustingSword / mastodon_bot.py
Last active March 4, 2024 14:00
一个简单的 mastodon bot
#!/usr/bin/env python3
import os
import random
from mastodon import Mastodon
API_BASE_URL = "https://me.ns.ci" # 注册网站,比如 https://me.ns.ci
EMAIL = os.environ.get("MASTODON_EMAIL") # 注册用的邮箱
PASSWORD = os.environ.get("MASTODON_PASSWORD") # 账号密码
汝南陳仲舉,潁川李元禮二人,共論其功德,不能定先後。蔡伯喈評之曰:「陳仲舉彊於犯上,李元禮嚴於攝下。犯上難,攝下易。」仲舉遂在三君之下,元禮居八俊之上。 (《世說新語·品藻第九》)
龐士元至吳,吳人並友之。見陸績、顧劭、全琮而為之目曰:「陸子所謂駑馬有逸足之用,顧子所謂駑牛可以負重致遠。」或問:「如所目,陸為勝邪?」曰:「駑馬雖精速,能致一人耳。駑牛一日行百里,所致豈一人哉?」吳人無以難。「全子好聲名,似汝南樊子昭。」 (《世說新語·品藻第九》)
顧劭嘗與龐士元宿語,問曰:「聞子名知人,吾與足下孰愈?」曰:「陶冶世俗,與時浮沈,吾不如子;論王霸之餘策,覽倚仗之要害,吾似有一日之長。」劭亦安其言。 (《世說新語·品藻第九》)
諸葛瑾弟亮及從弟誕,並有盛名,各在一國。于時以為「蜀得其龍,吳得其虎,魏得其狗」。誕在魏與夏侯玄齊名;瑾在吳,吳朝服其弘量。 (《世說新語·品藻第九》)
司馬文王問武陔:「陳玄伯何如其父司空?」陔曰:「通雅博暢,能以天下聲教為己任者,不如也。明練簡至,立功立事,過之。」 (《世說新語·品藻第九》)
正始中,人士比論,以五荀方五陳:荀淑方陳寔,荀靖方陳諶,荀爽方陳紀,荀彧方陳群,荀顗方陳泰。又以八裴方八王:裴徽方王祥,裴楷方王夷甫,裴康方王綏,裴綽方王澄,裴瓚方王敦,裴遐方王導,裴頠方王戎,裴邈方王玄。 (《世說新語·品藻第九》)
冀州刺史楊淮二子喬與髦,俱總角為成器。淮與裴頠、樂廣友善,遣見之。頠性弘方,愛喬之有高韻,謂淮曰:「喬當及卿,髦小減也。」廣性清淳,愛髦之有神檢,謂淮曰:「喬自及卿,然髦尤精出。」淮笑曰:「我二兒之優劣,乃裴、樂之優劣。」論者評之:以為喬雖高韻,而檢不匝;樂言為得。然並為後出之雋。 (《世說新語·品藻第九》)
劉令言始入洛,見諸名士而嘆曰:「王夷甫太解明,樂彥輔我所敬,張茂先我所不解,周弘武巧於用短,杜方叔拙於用長。」 (《世說新語·品藻第九》)
王夷甫云:「閭丘沖,優於滿奮、郝隆。此三人並是高才,沖最先達。」 (《世說新語·品藻第九》)
王夷甫以王東海比樂令,故王中郎作碑云:「當時標榜,為樂廣之儷。」 (《世說新語·品藻第九》)
汝南陳仲舉,潁川李元禮二人,共論其功德,不能定先後。蔡伯喈評之曰:「陳仲舉彊於犯上,李元禮嚴於攝下。犯上難,攝下易。」仲舉遂在三君之下,元禮居八俊之上。 (《世說新語·品藻第九》)
龐士元至吳,吳人並友之。見陸績、顧劭、全琮而為之目曰:「陸子所謂駑馬有逸足之用,顧子所謂駑牛可以負重致遠。」或問:「如所目,陸為勝邪?」曰:「駑馬雖精速,能致一人耳。駑牛一日行百里,所致豈一人哉?」吳人無以難。「全子好聲名,似汝南樊子昭。」 (《世說新語·品藻第九》)
顧劭嘗與龐士元宿語,問曰:「聞子名知人,吾與足下孰愈?」曰:「陶冶世俗,與時浮沈,吾不如子;論王霸之餘策,覽倚仗之要害,吾似有一日之長。」劭亦安其言。 (《世說新語·品藻第九》)
諸葛瑾弟亮及從弟誕,並有盛名,各在一國。于時以為「蜀得其龍,吳得其虎,魏得其狗」。誕在魏與夏侯玄齊名;瑾在吳,吳朝服其弘量。 (《世說新語·品藻第九》)
司馬文王問武陔:「陳玄伯何如其父司空?」陔曰:「通雅博暢,能以天下聲教為己任者,不如也。明練簡至,立功立事,過之。」 (《世說新語·品藻第九》)
正始中,人士比論,以五荀方五陳:荀淑方陳寔,荀靖方陳諶,荀爽方陳紀,荀彧方陳群,荀顗方陳泰。又以八裴方八王:裴徽方王祥,裴楷方王夷甫,裴康方王綏,裴綽方王澄,裴瓚方王敦,裴遐方王導,裴頠方王戎,裴邈方王玄。 (《世說新語·品藻第九》)
冀州刺史楊淮二子喬與髦,俱總角為成器。淮與裴頠、樂廣友善,遣見之。頠性弘方,愛喬之有高韻,謂淮曰:「喬當及卿,髦小減也。」廣性清淳,愛髦之有神檢,謂淮曰:「喬自及卿,然髦尤精出。」淮笑曰:「我二兒之優劣,乃裴、樂之優劣。」論者評之:以為喬雖高韻,而檢不匝;樂言為得。然並為後出之雋。 (《世說新語·品藻第九》)
劉令言始入洛,見諸名士而嘆曰:「王夷甫太解明,樂彥輔我所敬,張茂先我所不解,周弘武巧於用短,杜方叔拙於用長。」 (《世說新語·品藻第九》)
王夷甫云:「閭丘沖,優於滿奮、郝隆。此三人並是高才,沖最先達。」 (《世說新語·品藻第九》)
王夷甫以王東海比樂令,故王中郎作碑云:「當時標榜,為樂廣之儷。」 (《世說新語·品藻第九》)
#include <chrono>
using std::chrono::system_clock;
using std::chrono::time_point;
using std::chrono::duration_cast;
using std::chrono::microseconds;
class Timer {
public:
void start() {
start_time = system_clock::now();
@RustingSword
RustingSword / km_v2ex.js
Created March 27, 2020 06:37
km and v2ex tweak
// ==UserScript==
// @name Remove kmref
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://km.oa.com/*
// @match https://www.v2ex.com/*
// @run-at document-idle
// @grant none
@RustingSword
RustingSword / DoubanReadingStatus.js
Last active January 15, 2020 05:44
为豆瓣阅读动态添加对应的短评。
// ==UserScript==
// @name DoubanReadingStatus
// @namespace http://tampermonkey.net/
// @version 0.2
// @description 为豆瓣阅读动态添加对应的短评
// @author RustingSword
// @match https://book.douban.com/updates*
// @grant GM_xmlhttpRequest
// ==/UserScript==
@RustingSword
RustingSword / config.md
Created December 3, 2018 09:17 — forked from 0XDE57/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@RustingSword
RustingSword / fanfou_album.js
Last active June 15, 2019 02:58
从豆藤移植相册影院模式到饭否
// ==UserScript==
// @name fanfou相册增强
// @namespace https://fanfou.com
// @version 0.1
// @description album enhanced
// @author RustingSword
// @match https://*.fanfou.com/*
// @match http://*.fanfou.com/*
// @grant GM_getValue
// @grant GM_setValue
@RustingSword
RustingSword / bean_vine.js
Last active April 22, 2022 19:37
修复了豆藤的一点点问题,同时又引入了新的问题
// ==UserScript==
// @name 豆藤 Bean vine
// @namespace http://userscripts.org/scripts/show/49911
// @description 为豆瓣(www.douban.com)添加各种人性化的功能。
// @include https://*.douban.com/*
// @version 2015.3.24
// @grant GM_log
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @grant GM_getValue
@RustingSword
RustingSword / tsne_plot.py
Created April 23, 2018 06:09
Plot TSNE-ed embedding of word vectors generated by fasttext. Require https://github.com/DmitryUlyanov/Multicore-TSNE
#!/usr/bin/env python
#! coding: utf8
from __future__ import print_function
from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, LabelSet, HoverTool
import argparse
import numpy as np
from numpy.linalg import norm
from MulticoreTSNE import MulticoreTSNE as TSNE