Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
Planning some exciting stuff for 2020

Mingming Lou lmmsoft

😀
Planning some exciting stuff for 2020
View GitHub Profile
View gist:c4b7f02675f381f9fc8c9075c61a4d8f
# 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 / convert.py
Created Dec 18, 2018
将网易博客导出的xml转成jekyll的md格式
View convert.py
# 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")
View douban.fm to neteast music 豆瓣fm导出到网易云音乐
// 导出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 / WordsDetector.py
Created Aug 11, 2012 — forked from lastland/BeyesianAvg.py
尝试用这篇post: http://www.matrix67.com/blog/archives/5044 中的方法实现的一个自动中文抽词算法的Python程序
View WordsDetector.py
# -*- 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()])
@lmmsoft
lmmsoft / 12306.user.js
Created Jan 7, 2012 — forked from quietlynn/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
View 12306.user.js
/*
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
You can’t perform that action at this time.