This file contains 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
# Find all java classes in tree. (including auto-generated classes in 'target' folders: | |
find . -name "*.java" | xargs egrep -o "class [A-Z]\w+" | awk '{print $2}' | sort | uniq -c | sort -n | grep -v 1 | |
# Use git (faster). | |
#Ignores any auto-generated classes since they are typically inside ignored 'target' folders | |
git grep --extended-regexp --no-index "class [A-Z]\w+" | egrep -o "class [A-Z]\w+" | awk '{print $2}' | sort | uniq -c | sort -n | grep -v 1 |
This file contains 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
@Webservice(name="", serviceName="") | |
package javax.jws; | |
public @interface WebService {} | |
maven pom: | |
<dependency> |
This file contains 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
# Formatting and validation of Danish CPR number | |
# when saving we will throw away the dash "-" in the SSN and show it when retrieving | |
# | |
# Custom retrieval of formatted value: This is done by the method | |
# `formatted_cpr`. Use that in your views if you need it | |
# | |
# or in extreme cases you can override the getter method and call `formatted_cpr` | |
# | |
# Strategies for saving of unformatted value: | |
# 1. use either `base.after_validation` to hook into callbacks. This is a little annoying |
This file contains 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
package com.my.collections; | |
import java.io.Serializable; | |
import java.util.*; | |
/** | |
* <p/> | |
* Superclass for handling a collection of objects. He super class contains |
This file contains 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
function isDefined() { | |
varname=$1; | |
declare -p $varname >/dev/null 2>&1; | |
if [ "$?" -eq 0 ]; then | |
echo Defined; | |
fi; | |
} | |
http://nixcraft.com/shell-scripting/15375-testing-bash-variable-existence.html |
This file contains 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
MIN_COUNT = 2 | |
# Naïve implementation, just return whatever number I need | |
def sum_up_a(existing) | |
return 2 if existing == 0 | |
return 1 if existing == 1 | |
return 0 | |
end | |
sum_up_a(0) # => 2 |
This file contains 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
package dk.justaddwater.wtf | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
/** | |
* Created by IntelliJ IDEA. | |
* User: Jesper Rønn-Jensen |
This file contains 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
<div id="remote"> | |
<input class="typeahead" type="text" placeholder="Oscar winners for Best Picture"> | |
</div> |
This file contains 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
// ==UserScript== | |
// @name 'Læs også'-- men senere | |
// @namespace jespersscripts | |
// @version 0.1 | |
// @description "Læs også"-links flyttet til bund af artikel. Jeg var så træt af at der står "LÆS OGSÅ: ..." efter hvert andet afsnit på DRs websider. | |
// @match http://www.dr.dk/* | |
// @match http://dr.dk/* | |
// @copyright 2012+, Jesper Rønn-Jensen | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | |
// ==/UserScript== |
This file contains 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
#Line below added by jesper in idea.sh | |
IDEA_JDK="/opt/tools/jdk1.7.0_09" | |
#end line add |