This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd `dirname $0` | |
PID=$1 | |
BIN_DIR=`pwd` | |
cd $BIN_DIR | |
DUMP_DIR=./ | |
DUMP_DATE=`date +%Y%m%d%H%M%S` | |
DATE_DIR=$DUMP_DIR/$DUMP_DATE | |
if [ ! -d $DATE_DIR ]; then | |
mkdir $DATE_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
################################################################# | |
# deploy timediff project | |
# author: daniel | |
# last update: 2015-07-04 | |
################################################################ | |
readonly timediff_dir="/opt/web/timediff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> | |
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> | |
<Set name="contextPath">/timediff</Set> | |
<Set name="war">/opt/web/timediff</Set> | |
</Configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"gender": 2 | |
} | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.daniel.lambda; | |
import java.time.*; | |
import java.time.format.DateTimeFormatter; | |
import java.time.format.FormatStyle; | |
import java.time.temporal.ChronoUnit; | |
import java.time.temporal.TemporalAdjusters; | |
import java.util.Arrays; | |
import java.util.Date; | |
import java.util.Set; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme", | |
"font_face": "source code pro", | |
"font_size": 14, | |
"ignore_vcs_packages": true, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DeadLockDemo { | |
public static void main(String[] args) { | |
Object o1 = new Object(); | |
Object o2 = new Object(); | |
Runnable r1 = () -> { | |
synchronized(o1) { | |
try { | |
Thread.sleep(3000); | |
} catch (Exception e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.yousharp.designpattern.singleton; | |
/** | |
* 通过内部类实现单例模式,只有需要时才会创建示例; | |
* 如果需要使用单例模式,强烈推荐这种实现方式。 | |
* User: Daniel | |
* Date: 13-12-5 | |
* Time: 下午10:04 | |
*/ | |
public class InnerClassSingleton { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.nio.file.*; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.*; | |
import java.util.stream.Stream; | |
/** |
OlderNewer