Skip to content

Instantly share code, notes, and snippets.

View jahentao's full-sized avatar

Jiaheng Tao jahentao

  • HangZhou, Zhejiang
View GitHub Profile
@jahentao
jahentao / Windows删除目录下所有exe文件.bat
Last active November 4, 2017 05:22
实用的批处理脚本
@echo off
Setlocal enabledelayedexpansion
::CODER BY jahentao POWERD BY iBAT
(del /f *.exe)4>>%0 2>nul
pause
::1>nul 意思是不显示命令运行的正确提示
::2>nul 是不显示错误提示
::一起就是 正确错误的都不显示
@jahentao
jahentao / book.json
Last active November 17, 2017 02:43
gitbook book.json
{
"auth": "jahentao<[email protected]>",
"output": null,
"generator": "site",
"title": "Sample GitBook",
"description": null,
"isbn": "978-3-16-148410-0",
"extension": null,
"plugins": ["disqus"],
"pluginsConfig": {
@jahentao
jahentao / ThemeleafTemplateUtil.java
Created May 30, 2018 21:38
将HTML转换为Themeleaf模板,主要处理url引用
package com.jahentao.patentQuery.util.themeleaf;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.util.StringUtils;
import java.io.File;
import java.io.FileOutputStream;
@jahentao
jahentao / process.py
Created July 23, 2018 10:37
用gensim的LDA模型,分析得到MongoDB中body的主题词,并作为新字段插入
# -*- coding: utf-8 -*-
from gensim import corpora
from gensim.models import LdaModel
from nltk.corpus import stopwords
# 解析body域的HTML
from bs4 import BeautifulSoup
# 去除英文停用词,要先下载
from nltk.corpus import stopwords
# 去掉HTML标签
@jahentao
jahentao / CurrencyData.properties
Last active March 7, 2019 05:15
Ubuntu16.04.5编译openjdk-7u40-fcs-src-b43-26_aug_2013
# 修改 CurrencyData.properties 的日期等
#
# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
@jahentao
jahentao / graphicsmagick.sh
Created January 3, 2019 00:13 — forked from witooh/graphicsmagick.sh
Install Graphicsmagick
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:rwky/graphicsmagick
sudo apt-get update
sudo apt-get install graphicsmagick
@jahentao
jahentao / job.py
Created February 25, 2019 00:55
Python按时间倒序排序文件夹内文件 #Python
import os
# 按修改时间排序后,批量重命名文件,并加序号前缀
def renameFilesSortedByTime(dirPath):
mlist = []
# 获得文件名列表
files = os.listdir(dirPath)
# 获得名称带时间戳的新文件名列表
@jahentao
jahentao / Dockerfile
Last active March 6, 2019 10:18 — forked from twang2218/Dockerfile
Docker cron example
FROM python:3.5.2
ENV TZ=Asia/Shanghai
RUN apt-get update \
&& apt-get install -y cron \
&& apt-get autoremove -y
COPY ./cronpy /etc/cron.d/cronpy
CMD ["cron", "-f"]

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@jahentao
jahentao / Vagrantfile-nomad
Created March 14, 2019 09:07
Vagrantfile demo #demo
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo "Installing Docker..."
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88