Skip to content

Instantly share code, notes, and snippets.

# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
ko:
errors:
messages:
expired: "가(이) 만료되었습니다. 새로 요청해 주십시오"
not_found: "를(을) 찾을 수 없습니다"
already_confirmed: "이미 확인되었습니다, 다시 로그인 해 주십시오"
not_locked: "가(이) 잠기지 않았습니다"
not_saved:
import java.sql.*;
public class ConnectionAlone {
@SuppressWarnings("unused")
public static void main(String[] args) throws SQLException {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
}
@ruseel
ruseel / gist:5727052
Created June 7, 2013 04:21
boundedexecutor
public class BoundedExecutorService {
BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<Runnable>(4);
RejectedExecutionHandler rejectedExecutionHandler = new ThreadPoolExecutor.CallerRunsPolicy();
private ExecutorService executorService = new ThreadPoolExecutor(2, 2, 0L, TimeUnit.MILLISECONDS,
blockingQueue, rejectedExecutionHandler);
public void execute(Runnable command) {
executorService.submit(command);
}
@ruseel
ruseel / dist_authorized_keys
Last active December 20, 2015 05:19
dist authorized_keys
cat .ssh/authorized_keys | ssh $H 'mkdir -p .ssh; cat >> .ssh/authorized_keys; chmod go-w .ssh; chmod 600 .ssh/authorized_keys'
<bean id="dataSource" class="com.acmsoft.datasource.PropertyConfiguredDataSourceFactoryBean">
<property name="envName" value="ACMSOFT_ENV"></property>
<property name="productionProperty" value="com.acmsoft.production.properties"></property>
<property name="devProperty" value="com.acmsoft.dev.properties"></property>
</bean>
public class PropertyConfiguredDataSourceFactoryBean implements FactoryBean<DataSource> {
private String productionProperty;
private String devProperty;
private String envName;
public DataSource getObject() throws Exception {
String propFileName = getPropertyFilenameByENV();
Properties p = PropertiesLoaderUtils.loadAllProperties(propFileName);
@ruseel
ruseel / Gemfile
Last active December 20, 2015 15:29
jruby - ActiveRescord Example
source 'https://rubygems.org'
gem 'activerecord', '<= 3.2'
gem 'activerecord-jdbcmssql-adapter', :platform => :jruby
@ruseel
ruseel / gist:6247704
Created August 16, 2013 06:20
spring i18n
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="messages"></property>
</bean>
<#import "/spring.ftl" as spring />
<@spring.messageText "greeting", ["john"] />
@ruseel
ruseel / package.xml
Created August 20, 2013 00:25
maven assembly plugin
<assembly>
<!-- this will create an extra resource project-1.1.1-package.zip, you can
choose jar as well in the format-->
<id>package</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<!-- Insert here extra files as configs or, batch files, resources, docs etc-->
<fileSets>
n_rank={0,choice,0#zero|1#1st|2#2nd|3#3rd|3<{0}th}