This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
public class User extends AbstractEntity { | |
@OneToOne(optional = true, cascade = CascadeType.ALL, mappedBy = "owner", orphanRemoval = true) | |
private UserDog dog; | |
... | |
@Entity | |
public class UserDog extends AbstractEntity { | |
@OneToOne(optional = false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'idea' | |
subprojects { | |
configurations { provided } | |
sourceSets { | |
main { compileClasspath += configurations.provided } | |
} | |
idea { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'idea' | |
idea { | |
project { | |
jdkName = '1.7' | |
languageLevel = '1.7' | |
ipr { | |
withXml { provider -> | |
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def repositoryPath = 'lib' | |
repositories { | |
maven { | |
url "http://mavenrepo.google-api-java-client.googlecode.com/hg" | |
} | |
maven { | |
url "http://boilerpipe.googlecode.com/svn/repo/" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vi /etc/security/limits.conf | |
#add: | |
user soft nofile 1000000 | |
user hard nofile 1000000 | |
root soft nofile 1000000 | |
root hard nofile 1000000 | |
vi /etc/pam.d/sudo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sysctl -w kernel.shmmax=536870912 #see shared_buffers | |
sysctl -w kernel.shmall=262144 | |
vi /etc/sysctl.conf | |
kernel.shmmax=536870912 | |
kernel.shmall=262144 | |
postgres.sql: | |
fsync=on | |
synchronous_commit=off #may lead to lost transactions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use test classes from spring-common as dependency to tests of current module | |
testCompile files(this.project(':spring-common').sourceSets.test.output) | |
// use testCompile dependencies from spring-common as dependency to tests of current module | |
testCompile files(this.project(':spring-common').sourceSets.test.runtimeClasspath) | |
def isClassesDependency(module) { | |
(module instanceof org.gradle.plugins.ide.idea.model.ModuleLibrary) && module.classes.iterator()[0].url.toString().contains(rootProject.name) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
screen -S [name of screen] -d -m [command to run] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- put to C:\Users\${USER}\.IdeaIC11\config\templates as iterations.xml --> | |
<templateSet group="iterations"> | |
<!-- slf+ TAB to generate logger --> | |
<template name="slf" value="private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger($CLASS_NAME$.class);" description="Creates sfl4j logger" toReformat="true" toShortenFQNames="true" useStaticImport="true"> | |
<variable name="CLASS_NAME" expression="className()" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML_TEXT" value="false" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var now = new Date(); | |
var quarter = Math.floor((now.getMonth() / 3)); | |
var firstDate = new Date(now.getFullYear(), quarter * 3, 1); | |
var endDate = new Date(firstDate.getFullYear(), firstDate.getMonth() + 3, 0); |