Skip to content

Instantly share code, notes, and snippets.

View robertoalvesme's full-sized avatar
🎯
Focusing

Roberto Alves robertoalvesme

🎯
Focusing
View GitHub Profile
@jweyrich
jweyrich / TransactionalTask.java
Last active December 29, 2015 16:09
Quick and ugly support for transactional tasks using vraptor-tasks and Hibernate.
package ...;
import br.com.caelum.vraptor.tasks.Task;
import javax.inject.Inject;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@chilicat
chilicat / scp-ssh.gradle
Last active July 10, 2023 02:53
A simple gradle task to upload a file via SCP to a remote host and to execute a command via SSH on a remote host.
repositories { mavenCentral() }
configurations { sshAntTask }
dependencies { sshAntTask 'org.apache.ant:ant-jsch:1.9.2' }
ant.taskdef(
name: 'scp',
classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
classpath: configurations.sshAntTask.asPath)