Skip to content

Instantly share code, notes, and snippets.

View fatroom's full-sized avatar

Roman Romanchuk fatroom

View GitHub Profile
studie <- function() {
r <- c()
for (k in 1:16) {
r <- c(r, vierFunk(k))
}
return (matrix(r, nrow = 16, ncol = 4))
}
@fatroom
fatroom / KillBuildTest.java
Created June 25, 2013 12:52
Killer test inspired by Kill Bill movie
public class KillBuildTest {
@Test
public void touchOfDeath() {
fail("Bang bang!");
}
}
@fatroom
fatroom / pom.xml
Created August 31, 2012 10:18
Maven exclude transitive dependencies by wildcard
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
</exclusion>
@fatroom
fatroom / .gitconfig
Created June 8, 2012 16:25
Enabling of empty folder removel in svn via git
[svn]
rmdir = true
@fatroom
fatroom / gitsvnrmdir.sh
Created June 8, 2012 16:13
Automatic removing of empty folders in svn via git
git config --global svn.rmdir=true
@fatroom
fatroom / ConsoleInput.m
Created March 26, 2012 14:50
How to read console input
NSLog(@"Input:");
NSFileHandle *input = [NSFileHandle fileHandleWithStandardInput];
NSData* data = [input availableData];
if(data) {
NSString* str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"Here it go: %@", str);
[str release];
}
@fatroom
fatroom / missingRetina.sh
Created March 9, 2012 14:50
Script for search of missing retina images in iPhone projects
#!/bin/bash
FILES=`find . -name "*.png"`
for file in $FILES
do
if [[ "$file" == *@2x.png ]]
then
continue
We couldn’t find that file to show.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>
public void validate(Object obj, Errors e) {
ValidationUtils.rejectIfEmpty(e, "name", "name.empty", "Can't be empty");
ValidationUtils.rejectIfEmpty(e, "nickname", "nickname.empty","Can't be empty");
}