Skip to content

Instantly share code, notes, and snippets.

View jun1st's full-sized avatar
🎯
Focusing

feng qijun jun1st

🎯
Focusing
View GitHub Profile
@jun1st
jun1st / __consumer_offsets.json
Created December 29, 2019 13:31
__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] },
@jun1st
jun1st / eslint.js
Created October 12, 2019 13:52
eslint.js
module.exports = {
env: {
// 指定脚本的运行环境。每种环境都有一组特定的预定义全局变量
es6: true,
node: true,
jest: true,
'react-native/react-native': true,
},
extends: [
// 一个配置文件可以从基础配置中继承已启用的规则
@jun1st
jun1st / tsconfig.json
Created October 12, 2019 13:46
tsconfig.json
{
"compilerOptions": {
/* Basic Options */
"target": "es5",
"module": "commonjs",
"allowJs": true,
"checkJs": true,
"jsx": "react-native",
"strict": true,
"allowSyntheticDefaultImports": true,
@jun1st
jun1st / disable mcafee endpoint protection.md
Created April 15, 2019 03:02 — forked from tegansnyder/disable mcafee endpoint protection.md
Disable McAffee Endpoint Protection OSX

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 February 19, 2019 08:16
quick sort partition example
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 February 19, 2019 07:38
Quick Sort Partition
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 January 31, 2019 08:41
merge sort java version
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;
}
@jun1st
jun1st / AWS4SignResult.java
Last active July 7, 2018 07:04
AWS4 Signer Base
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
public class AWS4SignResult {
private String amzDateTimeStamp;
# 头部描述信息(可选)
# 在 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 July 7, 2018 14:24
Java decode 小程序 encryptedData
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;