Skip to content

Instantly share code, notes, and snippets.

View gist:2375422
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
ko:
errors:
messages:
expired: "가(이) 만료되었습니다. 새로 요청해 주십시오"
not_found: "를(을) 찾을 수 없습니다"
already_confirmed: "이미 확인되었습니다, 다시 로그인 해 주십시오"
not_locked: "가(이) 잠기지 않았습니다"
not_saved:
View gist:5659843
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 Jun 7, 2013
boundedexecutor
View gist:5727052
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 Dec 20, 2015
dist authorized_keys
View 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'
View appContext
<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>
View PropertyConfiguredDataSourceFactoryBean.java
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 Dec 20, 2015
jruby - ActiveRescord Example
View Gemfile
source 'https://rubygems.org'
gem 'activerecord', '<= 3.2'
gem 'activerecord-jdbcmssql-adapter', :platform => :jruby
View gist:6247704
<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 Aug 20, 2013
maven assembly plugin
View package.xml
<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>
View message_en.properties
n_rank={0,choice,0#zero|1#1st|2#2nd|3#3rd|3<{0}th}