Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

feng qijun jun1st

🎯
Focusing
View GitHub Profile
@jun1st
jun1st / __consumer_offsets.json
Created Dec 29, 2019
__consumer_offsets.json
View __consumer_offsets.json
{
"version": 1,
"partitions": [
{ "topic": "__consumer_offsets", "partition": 0, "replicas": [1, 2, 3] },
{ "topic": "__consumer_offsets", "partition": 1, "replicas": [1, 2, 3] },
{ "topic": "__consumer_offsets", "partition": 2, "replicas": [1, 2, 3] },
{ "topic": "__consumer_offsets", "partition": 3, "replicas": [1, 2, 3] },
{ "topic": "__consumer_offsets", "partition": 4, "replicas": [1, 2, 3] },
{ "topic": "__consumer_offsets", "partition": 5, "replicas": [1, 2, 3] },
{ "topic": "__consumer_offsets", "partition": 6, "replicas": [1, 2, 3] },
View eslint.js
module.exports = {
env: {
// 指定脚本的运行环境。每种环境都有一组特定的预定义全局变量
es6: true,
node: true,
jest: true,
'react-native/react-native': true,
},
extends: [
// 一个配置文件可以从基础配置中继承已启用的规则
View tsconfig.json
{
"compilerOptions": {
/* Basic Options */
"target": "es5",
"module": "commonjs",
"allowJs": true,
"checkJs": true,
"jsx": "react-native",
"strict": true,
"allowSyntheticDefaultImports": true,
View disable mcafee endpoint protection.md

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@jun1st
jun1st / partition.txt
Last active Feb 19, 2019
quick sort partition example
View partition.txt
arr[] = {10, 80, 30, 90, 40, 50, 70}
Indexes: 0 1 2 3 4 5 6
low = 0, high = 6, pivot = arr[h] = 70
初始化, i = -1, i 保存的是最近一次比较比 pivot 值小的index。
遍历 from j = low to high-1
j = 0 : arr[j] <= pivot, do i++ and swap(arr[i], arr[j])
i = 0
arr[] = {10, 80, 30, 90, 40, 50, 70} // i = j, 本身不需要交换
@jun1st
jun1st / partition.java
Last active Feb 19, 2019
Quick Sort Partition
View partition.java
public static int partition(int arr[], int low, int high) {
int pivot = arr[high];
// index of smaller element
int i = (low -1);
for(int j = low; j < high; j++) {
if (arr[j] <= pivot) {
i++;
int temp = arr[i];
@jun1st
jun1st / mergeSort.java
Last active Jan 31, 2019
merge sort java version
View mergeSort.java
public static void merge(int[] arrayOne, int aLeft, int aRight,
int[] arrayTwo, int bLeft, int bRight,
int[] result) {
int i = aLeft, j = bLeft;
for(int k = 0; k <= aRight - aLeft + bRight - bLeft + 1; k++) {
if (i > aRight) { //第一个数组没有元素了
result[k] = arrayTwo[j++];
continue;
}
View AWS4SignResult.java
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
public class AWS4SignResult {
private String amzDateTimeStamp;
View gist:40a4109b523a82d19e7c2e5ece2922e6
# 头部描述信息(可选)
# 在 PCL 的头部一般添加上本文件和作者的描述信息,在 Potatso App 中暂时没有实际作用。
name = "Potatso Sample Configuration"
author = "Potatso"
email = "potatso.com@gmail.com"
website = "http://manual.potatso.com"
description = "The sample PCF. This demonstrates the basic grammar of defining a PCL."
# 用户配置(Profile)
[PROFILE.sample]
@jun1st
jun1st / AES.java
Last active Jul 7, 2018
Java decode 小程序 encryptedData
View AES.java
import java.io.UnsupportedEncodingException;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Security;