Skip to content

Instantly share code, notes, and snippets.

View h2000's full-sized avatar

Alf Richter h2000

  • iba Consulting Gesellschaft
  • Germany/Leipzig
View GitHub Profile
trait Unique {
val id: String
}
/**
* Abstraction over a standard "Indexed" table.
*/
trait CrudComponent{ this: Profile =>
import profile.simple._
@h2000
h2000 / isis-intellij-setup-tips.txt
Created December 17, 2014 22:09
isis tips: intellij + jrebel + datanucleus
1. Change output paths from target-ide to target if necessary:
- Module Settings (F3)> Modules > for all modules:
- Paths Tab > change "Output path:" and "Test output path:" ../target-ide/.. to ../target/..
2. Add after make trigger to maven goal datanucleus:enhance
- Maven Projects (side tabs) > for all dom maven modules
- select: Plugins > datanucleus > datanucleus:enhance (right click) > execute after make
(https://www.jetbrains.com/idea/help/configuring-triggers-for-maven-goals.html)
3. Start isis with jrebel
@h2000
h2000 / isis-templates-idea.xml.patch
Created December 17, 2014 21:45
Changed getter name expression for properties and collections to capitalize(propertyName|collectionName)
From 17e1c950e87258159d73e71dd125c83fc62bf8e8 Mon Sep 17 00:00:00 2001
From: ari <haskell2000@gmail.com>
Date: Wed, 17 Dec 2014 10:44:56 +0100
Subject: [PATCH] Changed getter name expression for properties and collections
to capitalize(propertyName|collectionName)
---
isis-templates-idea.xml | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
@h2000
h2000 / gist:253cf47d79fcaae6dc06
Created December 10, 2014 21:47
ISIS 1.8. Replace @nAmed on classes with @DomainObjectLayout
Replace in Path:
Text to find: Named\((".*")\)((\n.*)*public class)
Replace with: DomainObjectLayout(named=$1)$2
[x] File mask(s): *.java
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConnectionFactory;
//import com.rabbitmq.client.QueueingConsumer;
import com.rabbitmq.client.GetResponse;
import com.rabbitmq.client.AMQP;
//import com.rabbitmq.client.*;
//import com.rabbitmq.client.MessageProperties;
//import com.rabbitmq.client.AlreadyClosedException;
import java.io.{ FileOutputStream, File }
import scala.io.Source
import scala.util.matching.Regex
object UpdateCopyrightHeaders extends App {
val encoding = "utf-8"
val copyrightLines: Seq[String] = "Copyright (C) 1894-2014 Example Corp. <http://www.example.com>".split("\n")
val srcDir = new File("src/")
def updateCopyright(file: File): Unit = {
@h2000
h2000 / gist:9160411
Last active August 29, 2015 13:56
bash script to merge two jars (e.g. for minecraft, commandline)
$ cat ~/merge.sh
#!/bin/bash
function die {
echo $1
exit -1
}
[[ $# -eq 2 ]] || die "$0 jar1 jar2"
@h2000
h2000 / gist:4257993
Created December 11, 2012 11:50 — forked from int128/gist:2360407
GitLab init script for Gentoo Linux
#!/sbin/runscript
# GitLab init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/gitlab/gitlab
GITLAB_USER=gitlab
depend() {
need net mysql redis
}
@h2000
h2000 / preconditions.epf
Created August 19, 2012 14:27 — forked from kberg/preconditions.epf
Add JDT Templates that set Guava Preconditions
# @title Add JDT templates that set Guava Preconditions
# @description Sets templates that surround expressions with Preconditions.check{NotNull,Argument,State}. Warning: this can replace any previously defined template so use with care.
# @task_type LASTMOD
#
# Written by Robert Konigsberg, 02-20-2012.
# See http://blatherberg.wordpress.com/2012/02/20/inserting-guava-preconditions-in-eclipse
#
file_export_version=3.0
/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.text.custom_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="java" deleted\="false" description\="Surround expression with checkNotNull Precondition." enabled\="true" name\="checkNotNull (instance)">${\:import(com.google.common.base.Preconditions)}Preconditions.checkNotNull(${word_selection})</template><template autoinsert\="false" context\="java" deleted\="false" description\="Surround expression with checkNotNull Precondition (with static import)." enabled\="true" name\="checkNo
@h2000
h2000 / filter
Created January 29, 2012 15:23 — forked from carstenlenz/filter
Eclipse Java code templates for google guava collections functionality
${retIt:newType(java.lang.Iterable)}<${iterable_type}> ${name:newName(retIt)} = ${itbls:newType(com.google.common.collect.Iterables)}.filter(${iterable}, new ${pred:newType(com.google.common.base.Predicate)}<${iterable_type}>() {
@Override public boolean apply(${iterable_type} ${input}) {
return ${false};
}
});