Skip to content

Instantly share code, notes, and snippets.

View r-winkler's full-sized avatar
🎯
Focusing

René Winkler r-winkler

🎯
Focusing
  • Bern, Switzerland
View GitHub Profile
@Configuration
public class PersistenceConfiguration {
@Bean
@ConfigurationProperties(prefix="spring.datasource")
@Primary
public DataSource dataSource() {
return DataSourceBuilder.create().build();
}
plugins {
id 'org.springframework.boot' version '1.5.8.RELEASE'
}
bootRepackage {
mainClass = 'ch.renewinkler.mobile_track.MobileTrackApplication'
}
apply plugin: 'java'
plugins {
id "com.moowork.node" version "1.2.0"
}
//node {
// version = '6.9.4'
// download = true
//}
task clean(dependsOn: 'npm_run_clean') {
allprojects {
buildscript {
repositories {
mavenCentral()
}
}
repositories {
mavenCentral()
include 'backend'
include 'frontend'
rootProject.children.each {
it.buildFileName = it.name + '.gradle'
}
@r-winkler
r-winkler / awk
Last active February 7, 2017 18:11
# execute awk file
awk -f users.awk /etc/passwd
# print specific column and show total lines processed
BEGIN { FS=":" ; print "Username"}
{print $1}
END {print "Total users= " NR}
# print column where it meets critera
BEGIN { FS=":" ; print "Username"}
@Retention(RetentionPolicy.RUNTIME)
public @interface Profiled {
}
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
@Aspect
@Order(Ordered.LOWEST_PRECEDENCE)
@Component
public class LoggerAspect {
private Logger logger;
public LoggerAspect() {
logger = LoggerFactory.getLogger(getClass());
}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>{your.package.main.class}</mainClass>
</transformer>
</transformers>
<filters>