Skip to content

Instantly share code, notes, and snippets.

View kezhenxu94's full-sized avatar
Working From Home

kezhenxu94 kezhenxu94

Working From Home
View GitHub Profile
@kezhenxu94
kezhenxu94 / test.json
Created March 28, 2018 02:31
A json file for testing
{"status":200,"errorMsg":"Operation OK!","data":[{"id":10202,"idolId":158,"activityId":1026,"active":1,"title":"可以","introduce":" ","firstFrame":"http://videodebugoutput.oss-cn-hongkong.aliyuncs.com/Act-Snapshot/e07821a403a442bfa27e1bcd037c50a5/1000.jpg","thumbnail":"http://upload.groupy.vip/video_thumbnail/2068135D-3AC8-4BB7-B982-48176A42DED2.jpg","thumbnailWidth":360,"thumbnailHeight":480,"videoWidth":360,"videoHeight":480,"publicType":0,"duration":3,"publishTime":1519804082000,"activity":{"id":1026,"title":"麦萌 x Groupy","description":"1位のアイドルはユーザー数が1000万人超えの中国最大級アフレコアプリ「麦萌対手戏」に声で出演!推しメンを応援してね~♪","rankingType":1,"position":1,"goal":"ランキング上位1名のアイドル","img":"http://image.groupy.vip/acticity_banner/activity-maimeng.jpg","tag":"Groupyx麦萌","actionInfo":"http://activity.groupy.cn/maimeng/index.html?activityId\u003d1026","shareLink":"http://share.groupy.cn/html/activity_maimeng/index.html?activityId\u003d1026","shareTitle":"【#Groupyx麦萌コラボ 】","shareDesc":"上位1名は中国最大級アフレコアプリ「麦萌対手戏」に声で出演!応援しよう!","startTime":15067872010
@kezhenxu94
kezhenxu94 / test-formatted.json
Created March 28, 2018 02:33
Formatted json file
{
"status": 200,
"errorMsg": "Operation OK!",
"data": [
{
"id": 10202,
"idolId": 158,
"activityId": 1026,
"active": 1,
"title": "可以",
@kezhenxu94
kezhenxu94 / pom.xml
Last active March 28, 2018 02:46
POM file of root project
<?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>me.kezhenxu94</groupId>
<artifactId>you-chat</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
@kezhenxu94
kezhenxu94 / pom.xml
Last active March 28, 2018 05:55
pom.xml of Authorization Server
<?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>
<artifactId>authorization</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>authorization</name>
@kezhenxu94
kezhenxu94 / mmonly.py
Last active March 30, 2018 08:09
mmonly.cc Spider
# -*- coding: utf-8 -*-
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from mmonly_cc.items import MmonlyCcItem
import re
import datetime
@kezhenxu94
kezhenxu94 / pipelines.py
Created March 30, 2018 08:38
pipelines.py
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy import Request
from scrapy.pipelines.images import ImagesPipeline
@kezhenxu94
kezhenxu94 / Generated.kt
Last active April 26, 2018 10:08
Generated code
data class T(
val currentUserUrl: String, //https://api.github.com/user
val currentUserAuthorizationsHtmlUrl: String, //https://github.com/settings/connections/applications{/client_id}
val authorizationsUrl: String, //https://api.github.com/authorizations
val codeSearchUrl: String, //https://api.github.com/search/code?q={query}{&page,per_page,sort,order}
val commitSearchUrl: String, //https://api.github.com/search/commits?q={query}{&page,per_page,sort,order}
val emailsUrl: String, //https://api.github.com/user/emails
val emojisUrl: String, //https://api.github.com/emojis
val eventsUrl: String, //https://api.github.com/events
val feedsUrl: String, //https://api.github.com/feeds
@kezhenxu94
kezhenxu94 / logger.sh
Created July 14, 2019 15:01
find out classes that have a different logger name
#!/bin/sh
# a wrong logger name is confusing when debugging
# this script will find out those classes that have
# a different logger name
find . -type f -print0 |
while IFS= read -r -d $'\0' file; do
if [[ ${file} =~ .java$ ]]; then
gawk 'BEGIN {
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@kezhenxu94
kezhenxu94 / ts-worker.ts
Created June 12, 2020 14:17
NodeJS worker with TypeScript
/*!
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0