Skip to content

Instantly share code, notes, and snippets.

@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active September 8, 2024 15:36
npm vs yarn command translation cheat sheet
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@mdellabitta
mdellabitta / gist:1444003
Created December 7, 2011 18:32
how do do spring jdbc transactions with jdbctemplate/transactiontemplate
public class ExodusWriter {
private JdbcTemplate jdbcTemplate;
private TransactionTemplate transactionTemplate;
public ExodusWriter(DataSource dataSource) {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
jdbcTemplate = new JdbcTemplate(transactionManager.getDataSource());
transactionTemplate = new TransactionTemplate(transactionManager);
}
def tryo[T]( f: => T )
( implicit onError: Throwable => Option[T] =
{ t:Throwable => None }): Option[T] =
{
try {
Some( f )
} catch {
case c => onError( c )
}
}