Skip to content

Instantly share code, notes, and snippets.

View oldratlee's full-sized avatar
🐥
Hello world!

李鼎 oldratlee

🐥
Hello world!
View GitHub Profile
@oldratlee
oldratlee / DisableSslVerification.java
Created April 28, 2015 06:29
Disable Ssl Verification
static boolean sslVerificationDisabled = false;
public static synchronized void disableSslVerification() {
if (sslVerificationDisabled) return;
try {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
@oldratlee
oldratlee / vcs-reading-list.md
Last active August 29, 2015 14:16
程序员必读书单-VCS

VCS看起来在“专业的软件开发素养”这个分类中。

VCS

VCS是软件开发生命线。首选git,让开发者主动感知仓库管理,生命周期才完整灵动。

所有不以VCS为一等公民的软件流程都是耍流氓!都会被遗忘而僵死!

使用VCS管理代码、发布/版本管理,在VCS上工作流展开有效的项目流程管理和高效的开发协同。

@oldratlee
oldratlee / developer-reading-list.md
Last active August 12, 2023 17:03
关于我的“程序员必读书单”

@peng_gong程序员必读书单不错,核对了一下自己。

“读完”指从头到尾读完的;“读过”是指有读但中途放下了。
当然有些书是在自己年轻时读完的,当时阅历尚浅理解吸收有限,要再读! 😊

PS:
这里个人强调于区分“读完” vs. “读过”,是因为对于编程了解原则还远远不够,循环往复的理解操练是标配,按这个节奏打穿一本书的体系是开始也是过程。
个人觉得如果连“读完”好书建立书中的体系这样级别的磨练都不行,那路是不是走得着急了! 😄

PPS: 📚我的豆瓣读书

@oldratlee
oldratlee / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@oldratlee
oldratlee / colorful-lines.sh
Created October 7, 2014 10:15
colorful-lines
#!/bin/bash
colorEcho() {
local color="$1"
shift
if [ -c /dev/stdout ] ; then
# if stdout is console, turn on color output.
echo -ne "\033[1;${color}m"
echo -n "$@"
echo -e "\033[0m"
else
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
条件概率公式:
P(A|B) = P(AB)/P(B)
P(AB) = P(A)P(B|A) = P(B)P(A|B)
P(A|B) = P(A)P(B|A)/P(B)
全概率公式:
P(A) = P(B1)P(A|B1) + P(B2)P(A|B2) + ... // B1,B2...是全集
@startuml
Bob->Alice : hello
@enduml
import org.dbunit.Assertion;
import org.dbunit.database.DatabaseConnection;
import org.dbunit.database.IDatabaseConnection;
import org.dbunit.dataset.DataSetException;
import org.dbunit.dataset.DefaultDataSet;
import org.dbunit.dataset.DefaultTable;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.xml.FlatXmlDataSet;
import org.dbunit.operation.DatabaseOperation;
import org.junit.Assert;
@oldratlee
oldratlee / memBiterStat.sh
Last active June 18, 2019 06:39
对内存使用超过10%进程,执行内存dump和pstack
#!/bin/bash
PROG=`basename $0`
timestamp=`date "+%Y%m%d_%H%M%S"`
TMP=/tmp/${PROG}_${timestamp}
ge() {
[ $(echo "$1 >= $2" | bc) == 1 ]
}
dumpMemBiter() {
@oldratlee
oldratlee / MethodTracer.java
Last active December 28, 2015 00:18
BTrace, MethodTracer
import com.sun.btrace.AnyType;
import com.sun.btrace.annotations.Kind;
import com.sun.btrace.annotations.Location;
import com.sun.btrace.annotations.OnMethod;
import com.sun.btrace.annotations.ProbeMethodName;
import static com.sun.btrace.BTraceUtils.print;
import static com.sun.btrace.BTraceUtils.printArray;
/*