This file contains hidden or 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
@Component class InTransaction { | |
@Transactional def execute[T](f: => T): T = f | |
} | |
object InTransaction { | |
def apply[T](f: => T): T = Global.ctx.getBean(classOf[InTransaction]).execute(f) | |
} | |
def findListByUserMatching(): EssentialAction = UserAction { user => | |
request => |
This file contains hidden or 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
case class AddressString(address: Address, newAddress: NewAddress) { | |
private def getNTh(n: Int, f: List[String] => Boolean): String = { | |
def getOnlyLastThree(string: String): List[String] = { | |
if (string.split(" ").length > 3) | |
string.split(" ").toList.tail | |
else | |
string.split(" ").toList | |
} | |
val a = if (f(getOnlyLastThree(address.region))) getOnlyLastThree(address.region)(n) else "" |
This file contains hidden or 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 | |
java -jar jenkins.war --httpPort=8080 |
This file contains hidden or 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
@Test | |
public void testGetPrescription() throws Exception { | |
NewPrescription prescription = new NewPrescription(); | |
assertEquals("two pill a day", prescription.getPrescription(new SeriousPatientStatus(), new AdultPatientType())); | |
assertEquals("one pill a day", prescription.getPrescription(new MildPatientStatus(), new AdultPatientType())); | |
assertEquals("one pill a day", prescription.getPrescription(new SeriousPatientStatus(), new ChildPatientType())); | |
assertEquals("half pill a day", prescription.getPrescription(new MildPatientStatus(), new ChildPatientType())); | |
} | |
public interface PatientStatus { |
This file contains hidden or 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
// 2. Double Dispatch 방식 리팩토링 | |
NewPrescription prescription = new NewPrescription(); | |
assertEquals("two pill a day", prescription.getPrescription(new SeriousPatientStatus(), new AdultPatientType())); | |
assertEquals("one pill a day", prescription.getPrescription(new MildPatientStatus(), new AdultPatientType())); | |
assertEquals("one pill a day", prescription.getPrescription(new SeriousPatientStatus(), new ChildPatientType())); | |
assertEquals("half pill a day", prescription.getPrescription(new MildPatientStatus(), new ChildPatientType())); | |
public class NewPrescription { | |
public String getPrescription(PatientStatus status, PatientType type) { |
This file contains hidden or 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 | |
if [ ! -f ./success ]; then | |
curl -g http://send --data-urlencode group=$1 --data-urlencode "msg=Failed $2 $3" | |
fi |
This file contains hidden or 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 ReadOnlyNotifier { | |
private List<String> getRelatedServices() { | |
// | |
} | |
public void notifyToRelatedServicesIfItNeeds(StopMessage stopMessage) { | |
if (getRelatedServices().size() > 0) { | |
if (notifyToRelatedServices(stopMessage) == false) { | |
throw new FailedReadOnlyNotificationException(); |
This file contains hidden or 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 ReadOnlyNotifier { | |
public List<String> getRelatedServices() { | |
return null; | |
} | |
public boolean notifyToRelatedServices(StopMessage stopMessage) { | |
return false; | |
} |
This file contains hidden or 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 /wave/build_deploy/service | |
rm -rf ./wave | |
git clone [email protected]:MinCha/wave.git | |
cd ./wave | |
mvn clean compile war:inplace -Dmaven-test.skip=true -Dphase=service | |
/wave/tomcat/bin/shutdown.sh | |
sleep 10 | |
rm -rf /wave/tomcat/webapps/* | |
cp -rf ./src/main/webapp/* /wave/tomcat/webapps/ |
This file contains hidden or 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 | |
####################################### | |
# Init | |
####################################### | |
temp=~/temp | |
yum_repo=/etc/yum.repos.d/nginx.repo | |
tomcat_bin=http://mirror.apache-kr.org/tomcat/tomcat-7/v7.0.47/bin/apache-tomcat-7.0.47.tar.gz | |
tomcat_pathname=apache-tomcat-7.0.47 | |
irteam_home=/home1/irteam | |
tomcat=/apps/tomcat |