Skip to content

Instantly share code, notes, and snippets.

@liangzai-cool
liangzai-cool / gitee.com-2-github.com.sh
Last active May 18, 2021 11:59
gitee.com所有仓库同步到github私有仓库
source_code_dir="~/sourcecode/gitee.com/"
token="your_gitee_com_token"
gh_token="your_github_com_token"
current_dir=$(pwd)
response=$(curl -X GET "https://gitee.com/api/v5/user/repos?access_token=${token}&sort=created&page=1&per_page=20")
project_count=$(echo $response | jq '. | length')
echo $project_count
for(( i = 0; i < $project_count; i = i + 1 ))
do
operation="clone"
@liangzai-cool
liangzai-cool / coding.net-2-github.com.sh
Created April 9, 2019 09:01
coding.net所有仓库同步到github私有仓库
source_code_dir="/Users/username/sourcecode/dev.tencent.com/"
token="your_coding_net_token"
gh_token="your_github_com_token"
current_dir=$(pwd)
response=$(curl -X GET "https://coding.net/api/user/projects?type=all&sort=&page=1&pageSize=100" -H "Authorization: token ${token}")
project_count=$(echo $response | jq '.data.list | length')
echo $project_count
for(( i = 0; i < $project_count; i = i + 1 ))
do
operation="clone"
@liangzai-cool
liangzai-cool / coding.net.sh
Created April 9, 2019 08:59
利用coding.net批量更新本地所有仓库
source_code_dir="/Users/username/sourcecode/dev.tencent.com/"
token="your_coding_net_token"
current_dir=$(pwd)
response=$(curl -X GET "https://coding.net/api/user/projects?type=all&sort=&page=1&pageSize=100" -H "Authorization: token ${token}")
project_count=$(echo $response | jq '.data.list | length')
echo $project_count
for(( i = 0; i < $project_count; i = i + 1 ))
do
operation="clone"
item=$(echo $response | jq -r ".data.list[$i]")
@liangzai-cool
liangzai-cool / DebugSSHTunnelProperties.java
Created March 18, 2019 08:58
利用jsch连接跳板机,将本地和公司服务器内网建立连接
package test.properties;
import com.google.common.net.HostAndPort;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
@liangzai-cool
liangzai-cool / build.gradle
Created September 19, 2018 14:08 — forked from rponte/build.gradle
Excluding global dependency from all configurations (Gradle)
// ...
configurations {
all*.exclude group: 'xml-apis', module: 'xmlParserAPIs'
}
// Equivalent to:
configurations {
all.collect { configuration ->
configuration.exclude group: 'xml-apis', module: 'xmlParserAPIs'
}
@liangzai-cool
liangzai-cool / env_luajit2.sh
Created September 11, 2018 14:48
/etc/init.d/env_luajit2.sh
export LUAJIT_LIB=/usr/local/luajit2/lib
export LUAJIT_INC=/usr/local/luajit2/include/luajit-2.1
export LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
@liangzai-cool
liangzai-cool / update_tree_data_code_column.sql
Last active August 29, 2018 09:06
更新数据库树结构的level和code列
-- 初始化
update tjyqhdmhcxhfdm set level = -1, code = '';
update tjyqhdmhcxhfdm set level = 0, code = concat(parentId, ',', id, ',') where parentId = 0;
-- 查询
select * from tjyqhdmhcxhfdm_2017 where level >= 0 order by level asc, parentId asc, code asc limit 1000;
-- 更新
update
tjyqhdmhcxhfdm t1 inner join tjyqhdmhcxhfdm_2017 t2 on t1.parentId = t2.id
@liangzai-cool
liangzai-cool / android-studio-disable-test-only-mode.md
Created January 17, 2018 12:27 — forked from xujiaao/android-studio-disable-test-only-mode.md
Disable 'testOnly' mode for Android Studio 3.0

Disable 'testOnly' mode for Android Studio 3.0

Android Studio 3.0 sets android:testOnly="true" automatically on APKs that are ran from the IDE.

However, for some devices (such as OPPO R11), the test-only APKs can never be installed ...

If you face the same problem, try add this line to your '/gradle.properties':

# gradle.properties

android.injected.testOnly=false

var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@liangzai-cool
liangzai-cool / Test.java
Created December 5, 2017 06:19
替换ASCII为160的空白字符
public class Test {
public static void main(String[] args) {
String s = "Iowa State University                                                                    Experimental Particle Physics                                                                            James Cochran, P.I.This proposal comprises activities in experimental high energy physics at Iowa State University that continue efforts at the CERN Large Hadron Collider (LHC) with the ATLAS Experiment under DOE grant DE-SC0009974 (2013-2016). Professors Chen, Cochran, and Prell continue to build on current work to search for physics beyond the standard model (BSM), especially new heavy particles, using techniques that the group has recently developed to identify boosted jets from W/Z bosons, top quarks, and Higgs bosons. In addition to the group's development of new search techniques, its searches for BSM physics, and its longstanding service contributions to the ATLAS tracking subsystems, the group has begun an upgrade R&D project t