Skip to content

Instantly share code, notes, and snippets.

@picacure
picacure / hr.css
Last active December 18, 2018 13:40
CSS 奇淫技巧
//
hr{
border-width: 0px;
border-top: 2px dashed #d8d8d8;
color: #d8d8d8;
height: 1px;
}
@bastengao
bastengao / OsCheck.java
Created December 8, 2013 04:50
load sigar library
/**
* helper class to check the operating system this Java VM runs in
* http://stackoverflow.com/questions/228477/how-do-i-programmatically-determine-operating-system-in-java
* compare to http://svn.terracotta.org/svn/tc/dso/tags/2.6.4/code/base/common/src/com/tc/util/runtime/Os.java
* http://www.docjar.com/html/api/org/apache/commons/lang/SystemUtils.java.html
*/
public final class OsCheck {
/**
* types of Operating Systems
*/
@precious-ming
precious-ming / gist:fff1b7d77172427629c9
Created September 20, 2014 07:53
常用正则表达式
常用的数字正则(严格匹配)
------------------------------
正则 含义
^[1-9]\d*$ 匹配正整数
^-[1-9]\d*$ 匹配负整数
^-?[1-9]\d*$ 匹配整数
^[1-9]\d*|0$ 匹配非负整数(正整数 + 0)
^-[1-9]\d*|0$ 匹配非正整数(负整数 + 0)
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ 匹配正浮点数
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ 匹配负浮点数
@montanaflynn
montanaflynn / port.go
Created January 7, 2016 08:21
Port package which finds available ports or checks if a port is available
package port
import (
"net"
"strconv"
)
// New gets an available port
func New() (port int, err error) {
@teekaay
teekaay / Dockerfile.java
Created February 24, 2017 18:23
Dockerfile for installing Java with Ubuntu base image
# Java 8 (Oracle) Dockerfile
# Base image: Ubuntu
# Installs: Java 8
FROM ubuntu:latest
# Install basic software support
RUN apt-get update && \
apt-get install --yes software-properties-common
* http://www.07net01.com/2016/04/1434487.html
1.引言
随着项目不断的增大,尤其是一个在不断开发完善的项目,随着需求变化,数据库的schema也会跟着变化,数据库也需要不断的扩充,加表加字段,(每一次的增加称作一次DB的迁移migration)你是否还在用着最原始的方式, 用文件管理每次的SQL升级脚本,加了哪些字段,加了那些表,现在可以用数据库版本控制工具轻而易举搞定了。
flyway支持Java API的操作方式,可以和spring 框架进行无缝连接,使其在系统启动的时候检查并升级数据库的版本(特别适合于java项目)。
2.flyway的特点
2.1使用它之前先要了解一些概念:
@alswl
alswl / hosts
Last active October 8, 2024 09:13
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@CoderChoy
CoderChoy / PhoneFormatCheckUtils.java
Created August 29, 2017 09:52
电话号码合法性验证
import android.support.annotation.NonNull;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by Leo
* on 2017/8/4.
*/
@baymaxium
baymaxium / content.md
Created October 18, 2017 13:01
线上服务内存OOM问题定位三板斧

原文:架构师之路

相信大家都有感触,线上服务内存OOM的问题,是最难定位的问题,不过归根结底,最常见的原因:

本身资源不够

申请的太多

资源耗尽

@yorickshan
yorickshan / Regular_Expression
Last active June 13, 2024 03:03
[Frequently-Used Regular Expression] 常用正则表达式总结 #regex
[正则表达式](http://www.runoob.com/regexp/regexp-intro.html)
一、校验数字的表达式
1 数字:^[0-9]*$
2 n位的数字:^\d{n}$
3 至少n位的数字:^\d{n,}$