Skip to content

Instantly share code, notes, and snippets.

View lmmsoft's full-sized avatar
😀
Planning some exciting stuff for 2024

Mingming Lou lmmsoft

😀
Planning some exciting stuff for 2024
View GitHub Profile
@lmmsoft
lmmsoft / 12306.user.js
Created January 7, 2012 21:56 — forked from quietlynn/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
@lmmsoft
lmmsoft / WordsDetector.py
Created August 11, 2012 13:07 — forked from lastland/BeyesianAvg.py
尝试用这篇post: http://www.matrix67.com/blog/archives/5044 中的方法实现的一个自动中文抽词算法的Python程序
# -*- coding=utf-8 -*-
# 修改了原gist里space tab混乱的情况
import feedparser
import re
import collections
import math
def info_entropy(words):
result = 0
total = sum([val for _, val in words.iteritems()])
// 导出douban.fm的红星歌曲到网易云音乐
// 具体使用方法见 https://www.zhihu.com/question/34521014/answer/177048898
var a = "\n<?xml version=\"1.0\" encoding=\"windows-1252\"?>\n<List ListName=\"豆瓣红心\">\n";
for(var i in $$(".songlist-song .top")) {
a = a
+ "<File><FileName>"
+ $$(".songlist-song .top")[i].querySelector(".titles p span .artist-name").innerText.replace("&","&amp;")
+ "-"
+ $$(".songlist-song .top")[i].querySelector(".titles h3 .link").innerText.replace("&","&amp;")
+ "</FileName></File>\n"
@lmmsoft
lmmsoft / convert.py
Created December 18, 2018 16:52
将网易博客导出的xml转成jekyll的md格式
# from xml.dom.minidom import parse
import xml.dom.minidom
import os
import datetime
def parse_xml(inputFile):
domtree = xml.dom.minidom.parse(inputFile)
root = domtree.documentElement
blog_elements = root.getElementsByTagName("blog")
@lmmsoft
lmmsoft / gist:c4b7f02675f381f9fc8c9075c61a4d8f
Created February 21, 2020 15:35
Dockerfile 使用北京时间
# Dockerfile 使用北京时间
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
# or
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
# 1、CentOS6、Ubuntu16
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 2、CentOS7、RHEL7、Scientific Linux 7、Oracle Linux 7 最好的方法是使用timedatectl命令
@lmmsoft
lmmsoft / lvip_unzip.py
Created June 10, 2023 10:54
把百度云 .livp 格式的备份照片,解压成 jpg 和 mov 格式
import os
import zipfile
def unzip_files(dir_path):
"""解压指定目录下的所有 .livp 文件"""
files = os.listdir(dir_path)
for file_name in files:
if file_name.endswith('.livp'):
file_path = os.path.join(dir_path, file_name)