Skip to content

Instantly share code, notes, and snippets.

@chenzhenjia
chenzhenjia / EasyExcelReader.kt
Last active August 6, 2024 08:06
spring batch easyexcel item reader kotlin
import com.alibaba.excel.EasyExcel
import com.alibaba.excel.context.AnalysisContext
import com.alibaba.excel.event.AnalysisEventListener
import org.springframework.batch.item.ExecutionContext
import org.springframework.batch.item.ItemStreamReader
import java.util.concurrent.Executors
import java.util.concurrent.Semaphore
class EasyExcelReader<T>(
private val file: String,
@chenzhenjia
chenzhenjia / WBLogin.js
Created October 16, 2017 07:24
微博登录
const rp = require('request-promise');
const RSAKey = require('./WBPassword');
const Promise = require('promise');
// rp.debug = true;
/**
* 微博的预先登录,用来获取微博的公钥
* @param username 用户名
*/
@chenzhenjia
chenzhenjia / WBPassword.js
Created October 16, 2017 06:42
微博加密密码的 js
const RSAKey = function () {
function bt (a) {
var b = bp(a, this.n.bitLength() + 7 >> 3);
if (b == null)
return null;
var c = this.doPublic(b);
if (c == null)
return null;
var d = c.toString(16);
@chenzhenjia
chenzhenjia / RandomUtils.java
Created August 2, 2017 02:40
生成随机密码
private static final List<String> PWD_CHARS;
static {
PWD_CHARS = new ArrayList<String>();
PWD_CHARS.add("123456789");
PWD_CHARS.add("qwertyuipkjhgfdsazxcvbnm");
PWD_CHARS.add("QWERTYUPLKJHGFDSAZXCVBNM");
}
/**
@chenzhenjia
chenzhenjia / Input.js
Created July 27, 2017 06:00
react native 的自定义的 input,可以在右边显示其它组件
import React from 'react';
import {
TextInput,
View,
StyleSheet
} from 'react-native';
import PropTypes from 'prop-types'
export default class LoginInput extends React.Component {
constructor (props) {
@chenzhenjia
chenzhenjia / Input.js
Created July 27, 2017 03:23
react native 的自定义圆角 input
import React from 'react';
import {
TextInput,
View,
StyleSheet
} from 'react-native';
import PropTypes from 'prop-types'
export default class LoginInput extends React.Component {
constructor (props) {
@chenzhenjia
chenzhenjia / ProgressAlert.js
Created July 26, 2017 09:49
使用 antd-mobile 封装的 react-native ProgressAlert组件
import React from 'react';
import {
StyleSheet,
View,
Text
} from 'react-native';
import { Modal, Progress } from 'antd-mobile';
import PropTypes from 'prop-types';
@chenzhenjia
chenzhenjia / main.cpp
Created July 20, 2017 01:40
c++ v8 调用 JavaScript 函数
#include <iostream>
#include <fstream>
#include <v8.h>
#include <libplatform/libplatform.h>
using namespace v8;
using namespace std;
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
public: