Skip to content

Instantly share code, notes, and snippets.

@ufuk
ufuk / postgres-create-drop-index-without-locking.sql
Last active March 10, 2018 20:43 — forked from okanmenevseoglu/postgres-create-drop-index-online.sql
Create/Drop a database index without locking the table's selects, inserts, etc. on PostgreSQL
CREATE INDEX CONCURRENTLY your_index_name on your_table_name (your_column_name);
DROP INDEX CONCURRENTLY your_index_name;
@ufuk
ufuk / ApplicationContextHolder.java
Last active December 17, 2022 14:16 — forked from baybatu/getting-spring-bean-from-unmanaged-area.java
Utility bean for getting Spring beans from static context.
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class ApplicationContextHolder implements ApplicationContextAware {
private static ApplicationContext applicationContext;