Skip to content

Instantly share code, notes, and snippets.

View zhanzhenchao's full-sized avatar
:octocat:
Focusing

Rico zhanzhenchao

:octocat:
Focusing
View GitHub Profile
@madan712
madan712 / JigsawImage.java
Created September 8, 2012 07:47
Java program to cut an image into number of pieces for a Jigsaw puzzle
/* JigsawImage.java
* @author: Madan Chaudhary
* @blog: javaxp.com
* */
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
@binjoo
binjoo / Arith.java
Created October 27, 2012 09:59
JAVA:BigDecimal加减乘除运算
import java.math.BigDecimal;
/**
* 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精确的浮点数运算,包括加减乘除和四舍五入。
*/
public class Arith { // 默认除法运算精度
private static final int DEF_DIV_SCALE = 10; // 这个类不能实例化
private Arith() {
}
@lesleh
lesleh / chunkArray.java
Last active March 10, 2024 20:16
Java function to split an array into chunks of equal size. The last chunk may be smaller than the rest.
// Example usage:
//
// int[] numbers = {1, 2, 3, 4, 5, 6, 7};
// int[][] chunks = chunkArray(numbers, 3);
//
// chunks now contains [
// [1, 2, 3],
// [4, 5, 6],
// [7]
// ]
@oakhole
oakhole / RandomValidateCode.java
Last active January 10, 2018 15:51
生成随机验证码
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@fqrouter
fqrouter / readme.txt
Last active May 11, 2024 03:22
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@gokulkrishh
gokulkrishh / media-query.css
Last active November 10, 2024 02:00
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
{
"stats": {},
"api": {
"services": [
"StatsService"
],
"tag": "api"
},
"policy": {
"levels": {
@tjx666
tjx666 / cloudSettings
Last active December 25, 2023 01:56
Visual Studio Code Settings Sync Gist
{"lastUpload":"2022-02-14T06:16:33.865Z","extensionVersion":"v3.4.3"}
@mikeyh
mikeyh / SMJobBlessUtil-python3.py
Last active July 23, 2024 15:46
SMJobBlessUtil.py for Python3 / Xcode 13.3 / macOS Monterey 12.3 (with workaround for otool arm64 weirdness)
#! /usr/bin/python3
#
# File: SMJobBlessUtil.py
#
# Contains: Tool for checking and correcting apps that use SMJobBless.
#
# Written by: DTS
#
# Copyright: Copyright (c) 2012 Apple Inc. All Rights Reserved.
#