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 org.apache.commons.collections.MapIterator; | |
import org.apache.commons.collections.map.LRUMap; | |
import java.util.ArrayList; | |
/** | |
* Created by Tu Pham Phuong - phamptu@gmail.com on 6/30/15. | |
*/ | |
public class InMemoryCache<K, T> { |
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
from config import config | |
__author__ = 'Tu Pham Phuong' | |
__create_date__ = '4/24/15' | |
from fabric.api import * | |
deploy_dir = '/home/tupp/code/api' | |
def development(): |
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
Akka.system().scheduler().schedule( | |
Duration.create(0, TimeUnit.MILLISECONDS), | |
Duration.create(5, TimeUnit.MILLISECONDS), //Frequency 5 minutes | |
new Runnable() { | |
public void run() { | |
Logger.debug("Run from Akka scheduler"); | |
} | |
}, | |
Akka.system().dispatcher() | |
); |
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 boolean equals(Object o){ | |
if (!(o instanceof MyObject)) | |
return false; | |
... | |
} |
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 static TemplateService createTemplateService() { | |
return new TemplateService(); | |
} |
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 controllers; | |
import org.junit.*; | |
import static org.junit.Assert.*; | |
/** | |
* Created by Tu Pham Phuong - phamptu@gmail.com on 1/11/16. | |
*/ | |
public class BasicTest { | |
@BeforeClass |
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 com.google.common.cache.*; | |
import org.junit.Test; | |
import java.util.HashMap; | |
import java.util.Map; | |
import static org.fest.assertions.Assertions.assertThat; | |
/** | |
* Created by Tu Pham Phuong - phamptu@gmail.com on 7/2/15. |
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 org.junit.Before; | |
import org.junit.Test; | |
import static org.junit.Assert.*; | |
import org.junit.experimental.runners.Enclosed; | |
import org.junit.runner.RunWith; | |
/** | |
* Created by Tu Pham Phuong - phamptu@gmail.com on 1/13/16. | |
*/ | |
@RunWith(Enclosed.class) |
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
sudo touch /var/run/supervisor.sock | |
sudo chmod 777 /var/run/supervisor.sock | |
sudo service supervisor restart |
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
CREATE TABLE `country` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`country_code` varchar(2) NOT NULL, | |
`country_name` varchar(100) NOT NULL, | |
PRIMARY KEY (`id`), | |
KEY `cc` (`country_code`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
INSERT INTO `country` (`id`, `country_code`, `country_name`) | |
VALUES |
OlderNewer