Skip to content

Instantly share code, notes, and snippets.

View fikovnik's full-sized avatar

Filip Krikava fikovnik

View GitHub Profile
@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'
@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 / 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 / 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 / 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 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 / 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(
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_102, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core
@fikovnik
fikovnik / install.sh
Last active June 7, 2023 09:01
Install dotfiles
#!/bin/bash -x
BACKUP_DIR="$HOME/.dotfiles-backup"
[ -d $HOME/.dotfiles ] || git clone --bare https://github.com/fikovnik/dot-files.git $HOME/.dotfiles
function config {
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
@fikovnik
fikovnik / tmux_build_from_source_CentOS.sh
Created July 27, 2017 15:06 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from source.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.5
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}