Skip to content

Instantly share code, notes, and snippets.

<div th:each={role : ${roles}>
<select>
<option th:each="user : ${users}" th:attr="selected=${formBean.membershipList.?[user.id == user.id AND userAssetRole.id == role.id]} ? 'selected'" th:text="${user.firstName} + ' ' + ${user.lastName}">John Smith</option>
</select>
</div>
MAIN FILE
<table>
<tr th:each="object : ${objects}" th:include="admin/objects/list_partial :: row" th:attr=data-id=${object.id}>
</tr>
</table>
Include
@dstarh
dstarh / thymeleaf.html
Created September 13, 2012 13:55
thymeleaf th:attr
<tr th:each="obj : ${objects}" th:fragment="row" th:attr="data-obj-id=${obj.id}">
<td th:attr="data-obj-id=${obj.id}" th:text="${obj.id}> </td>
</tr>

Custom Favicons for sites See - https://skitch.com/dstarh/exi5e/menubar - these are my custom github icons that tell me which project I'm in without having to click the tab

Note this was done in chrome but will likely work in firefox with greasemonkey

  • Install Tamper Monkey
  • Create a new userscript based on the attached user script changing the match url and the url in the addFavicon (note for my images i just used skitch and shared the links you can get the direct image link from the link page)
  • note the match url can be any part of a domain with * replacing any portion of it.
  • Reload the page, it should now have your custom favicon
@dstarh
dstarh / settings.js
Created August 28, 2012 14:53
settings
{
"analysis":{
"analyzer":{
"customAnalyzer":{
"type":"custom",
"tokenizer":"standard",
"stopwords":"_none_",
"filter": ["custom_stop"]
}
},
@dstarh
dstarh / alias.sh
Created June 19, 2012 02:22
alias -p | grep git
alias __git_find_on_cmdline='__git_find_subcommand'
alias g='git'
alias ga='git add'
alias gall='git add .'
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gci='git commit --interactive'
alias gcl='git clone'
@dstarh
dstarh / osx.custom.bash
Created April 30, 2012 18:55
custom osx plugin
#!/usr/bin/env bash
function copy() {
if [ ! $(uname) = "Darwin" ]
then
echo "This function only works with Mac OS X"
return 1
fi
cat "$*" | /usr/bin/pbcopy
}
@dstarh
dstarh / gist:1085432
Created July 15, 2011 19:58
switch tag
#{layout.tags.switch value:3}
#{layout.tags.block case:1}
do for 1
#{/layout.tags.block}
#{layout.tags.block case:2}
do for 2
#{/layout.tags.block}
#{layout.tags.block case:3}
do for 3
#{/layout.tags.block}
package adt.reflexam.transformer;
public interface GenericTransformer<F, T> {
public T transform(F from);
}
@dstarh
dstarh / gist:921930
Created April 15, 2011 15:54
warning you're going to be dumber after reading this
package util.validation;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import play.data.validation.Check;
public class RequiredIfOtherEqualsValueMin extends Check {