Skip to content

Instantly share code, notes, and snippets.

View fikovnik's full-sized avatar

Filip Krikava fikovnik

View GitHub Profile
@fikovnik
fikovnik / CMakeFile.txt
Created March 31, 2017 14:16
Getting R and Rcpp CPP and LD flags
set(NUM_TRUNC_CHARS 2)
execute_process(
COMMAND R CMD config --cppflags
OUTPUT_VARIABLE RCPPFLAGS)
string(SUBSTRING ${RCPPFLAGS} ${NUM_TRUNC_CHARS} -1 RCPPFLAGS)
include_directories(${RCPPFLAGS})
message("R CPP flags: ${RCPPFLAGS}")
execute_process(
@fikovnik
fikovnik / build.gradle
Created May 8, 2016 20:45
Synchronize maven repository from gradle module dependencies
task syncMavenRepository(type: JavaExec) {
classpath = configurations.mavenEmbedder
main = 'org.apache.maven.cli.MavenCli'
systemProperties['maven.multiModuleProjectDirectory'] = projectDir
args = [
'--errors',
'--batch-mode',
'--settings', '../config/repo-settings.xml',
'--file', "${buildDir}/pom.xml",
"org.apache.maven.plugins:maven-dependency-plugin:2.10:go-offline"
@fikovnik
fikovnik / ProcessFreemarkerTemplateTask.groovy
Created May 8, 2016 20:11
Process freemarker template as a gradle task
package com.oracle.bacs
import freemarker.template.Configuration
import freemarker.template.TemplateException
import freemarker.template.TemplateExceptionHandler
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
/**
* Processes a freemarker {@code template} using given {@code properties},
@fikovnik
fikovnik / build.gradle
Created May 8, 2016 19:58
Building maven plugins by gradle
configurations {
mavenEmbedder
}
dependencies {
compile "org.apache.maven:maven-core:$mavenVersion"
compile "org.apache.maven:maven-plugin-api:$mavenVersion"
compile 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.4'
mavenEmbedder "org.apache.maven:maven-embedder:$mavenVersion"
@fikovnik
fikovnik / AnnotationHelperTest.java
Created November 20, 2015 12:56
Tests eclipse link moxy annotation helper
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.bacs.metadata.internal.binding;
import org.eclipse.persistence.jaxb.JAXBContextFactory;
import org.eclipse.persistence.jaxb.JAXBContextProperties;
import org.eclipse.persistence.jaxb.javamodel.reflection.AnnotationHelper;
import org.testng.annotations.Test;
@fikovnik
fikovnik / nand.st
Created November 9, 2015 13:15
BI-OMO lab 6 exercise 1
| nand func |
nand := [ :x :y | (x & y) not ].
func := [ :x :y |
"TODO: func"
].
Transcript cr;
show: 'x';
@fikovnik
fikovnik / build.gradle
Created October 27, 2015 11:40
Assertj generator in gradle
def assertjOutput = file('src-gen/test/java')
configurations {
assertj
}
dependencies {
testCompile 'org.assertj:assertj-core:3.2.0'
assertj 'org.assertj:assertj-assertions-generator:2.0.0'
for i in .dot-files/*; do f=${i#.dot-files/dot}; if [ -f ~/$f ]; then echo "$f: exists"; else ln -s ".dot-files/dot$f" $f; fi done
@fikovnik
fikovnik / gist:9f40f9f6c9acdd79a060
Created June 3, 2015 12:33
Docker log related to #835 of weaveworks/weave
DEBU[1745] Calling POST /containers/{name:.*}/start
INFO[1745] POST /v1.15/containers/c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1/start
DEBU[1745] Warning: client and server don't have the same version (client: 1.3.1, server: 1.6.2)
INFO[1745] +job start(c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1)
DEBU[1745] activateDeviceIfNeeded(c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1)
DEBU[1745] libdevmapper(6): ioctl/libdm-iface.c:1750 (4) dm info docker-253:1-134574-c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1 OF [16384] (*1)
DEBU[1745] libdevmapper(6): ioctl/libdm-iface.c:1750 (4) dm create docker-253:1-134574-c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1 OF [16384] (*1)
DEBU[1745] libdevmapper(6): libdm-common.c:1348 (4) docker-253:1-134574-c81873b7ea1bd6c7b4b04a923cb3cabf922565ff830fc34753ee475d9f9bd5c1: Stacking NODE_ADD (252,4) 0:0 0600 [verify_udev]
DEBU[1745] libdevmapper(6): ioctl/libdm-ifa
@fikovnik
fikovnik / single-node-hdp-2.2-ambari-cluster
Last active August 29, 2015 14:16
Single node Ambari cluster based on HDP 2.2
{
"configurations" : [
{
"nagios-env" : {
"nagios_contact": "me@my-awesome-domain.example"
}
}
],
"host_groups" : [
{