This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
from datetime import datetime | |
from collections import Counter | |
from threading import Thread | |
from bs4 import BeautifulSoup | |
import matplotlib.pyplot as plt | |
base_url_fmt = "https://www.archlinux.org/news/?page=%d" | |
max_page = 13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# an addon for hexchat to remove the names of forwarding bots. | |
# | |
import hexchat | |
__module_name__ = 'bot-killer' | |
__module_version__ = '0.1.0' | |
__module_description__ = 'Eliminate the names of forwarding bots' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
; ACM-Mode | |
; | |
; This is not a complete work. | |
; Be sure to tweak it as you like before you use this! | |
; | |
; NOTE: I won't update this Gist when I make improvements to my own ACM mode. | |
; | |
; This file belongs to Public Domain. | |
; Original author: ksqsf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::net::{TcpListener, TcpStream}; | |
use std::io::prelude::*; | |
use std::io::{BufReader, Result, Write}; | |
use std::thread; | |
fn handle_client(mut stream: TcpStream) -> Result<()> { | |
thread::spawn(move || { | |
println!("A new thread spawned for {:?}", stream); | |
let mut reader = BufReader::new(stream.try_clone().unwrap()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
the USTC module | |
NOTE: this is an incomplete framework! extend it as you like. | |
PS: don't expect to receive updates or changes from me! this is not intended to be published anyway. :-p | |
""" | |
from bs4 import BeautifulSoup | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# This is an interactive program to help myself rename and move a bunch of | |
# music files. | |
# | |
# Written by ksqsf <i@ksqsf.moe> | |
import os | |
import glob | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(libc)] | |
extern crate libc; | |
use libc::*; | |
use std::panic::*; | |
use std::ptr::*; | |
fn main() { | |
unsafe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 首先,将 netease-cloud-music 移动到 netease-cloud-music.bin | |
# 然后将本文件保存为 /usr/bin/netease-cloud-music 并设置可执行权限 | |
FILE="$HOME/.ICEauthority" | |
BACKUP="$HOME/.ICEauthority.netease-cloud-music" | |
if [ -e $FILE ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar region-ring nil) | |
(defvar region-ring-max 60) | |
(defun push-region () | |
"Push the current region into the global region ring. The | |
current mark will not be popped off the mark ring." | |
(interactive) | |
(let ((buffer (current-buffer)) | |
(mark (copy-marker (mark-marker))) | |
(point (point-marker))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar wc-ring nil) | |
(defvar wc-ring-max 10) | |
(defun push-wc () | |
(if (not (null (get-register ?9))) | |
(set-register ?0 (get-register ?9))) | |
(dolist (i '(?9 ?8 ?7 ?6 ?5 ?4 ?3 ?2)) | |
(if (not (null (get-register (1- i)))) | |
(set-register i (get-register (1- i))))) | |
(window-configuration-to-register ?1)) |
OlderNewer