Skip to content

Instantly share code, notes, and snippets.

View ymartin59's full-sized avatar

Yves Martin ymartin59

View GitHub Profile
@ymartin59
ymartin59 / debug_env.yml
Created February 1, 2021 17:28
Ansible playbook to dump host environment, groups and variables
# Standalone easy-to-use one-file playbook
# Inspired from https://coderwall.com/p/13lh6w/dump-all-variables
- hosts: all
gather_facts: yes
become: no
connection: local
vars:
debug_file: "debug_env_{{ inventory_hostname }}.log"
@ymartin59
ymartin59 / IterableListScrollableResults.java
Created April 1, 2014 13:42
IterableListScrollableResults<E> is a partial wrapper view as a List<E> on an Hibernate ScrollableResults. When an existing code process a large amount of Hibernate entities as a List<E>, it allows to work with data in stream without a large code refactoring.
import java.util.AbstractList;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
/**
* A List<E> partial wrapper view on an Hibernate ScrollableResults.