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 / pom.xml
Last active March 17, 2019 03:29
maven插件打包可执行jar和依赖示例 #Maven
<!-- 一段maven插件打包可执行jar和相应依赖到./lib的示例 -->
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>microservice.demo.training21days</groupId>
<artifactId>helloworld-provider</artifactId>
<version>0.0.1-SNAPSHOT</version>
@jahentao
jahentao / add_goland_launcer
Last active June 22, 2019 06:01 — forked from rob-murray/add_intellij_launcer
Add launcher shortcut and icon for deepin
// create file:
sudo vim /usr/share/applications/goland.desktop
// add the following
[Desktop Entry]
Version=2018.3.5
Type=Application
Terminal=false
Exec=/usr/local/bin/goland.sh
Name=GoLand
@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

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@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"]
@jahentao
jahentao / job.py
Created February 25, 2019 00:55
Python按时间倒序排序文件夹内文件 #Python
import os
# 按修改时间排序后,批量重命名文件,并加序号前缀
def renameFilesSortedByTime(dirPath):
mlist = []
# 获得文件名列表
files = os.listdir(dirPath)
# 获得名称带时间戳的新文件名列表
@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 / 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 / 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 / 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;