Skip to content

Instantly share code, notes, and snippets.

public static void main (String[] args) {
List<String> fruits = new ArrayList<>();
fruits.add("Apple");
fruits.add("Banana");
fruits.add("Peach");
fruits.add("Orange");
fruits.add("Cherries");
fruits.add("Watermelon");
System.out.println("Before Fruits = " + fruits);
for (String fruit : fruits) {
@rangalo
rangalo / uploadButtonBind.js
Last active January 28, 2016 12:06
upload button bind
$("#profileImage").on ('mouseenter' , (function(e) {
$("#imgUploadButton").fadeIn();
});
@rangalo
rangalo / jcrop.js
Last active January 31, 2016 14:09
bind jcrop
$('body').on('click', '#IdWhereYouWatJcropt', function(e) {
bindJCrop($this);
});
<ui:repeat value="#{taskMap.value}" var="task">
<f:selectItem itemLabel="#{task.textInLocale}"
itemValue="#{task.value}"></f:selectItem>
</ui:repeat>
@rangalo
rangalo / checkbox.html
Created November 3, 2015 12:05
pf checkbox rendering.
<table id="currentPositionUpdate:roleBasedOnCustomer" class="inputWrap radioTable">
<tr>
<td>
<input name="currentPositionUpdate:roleBasedOnCustomer" id="currentPositionUpdate:roleBasedOnCustomer:0" value="clerk" type="checkbox" /><label for="currentPositionUpdate:roleBasedOnCustomer:0" class=""> Sachbearbeiter</label></td>
</tr>
<tr>
<td>
<input name="currentPositionUpdate:roleBasedOnCustomer" id="currentPositionUpdate:roleBasedOnCustomer:1" value="expert" type="checkbox" /><label for="currentPositionUpdate:roleBasedOnCustomer:1" class=""> Fachkraft</label></td>
</tr>
<tr>
@rangalo
rangalo / radioButton.html
Created November 3, 2015 12:03
pf radioButton rendering
<table id="companyInformationForm:companySize" class="inputWrap radioTable">
<tr>
<td>
<input type="radio" name="companyInformationForm:companySize" id="companyInformationForm:companySize:0" value="&lt;50" /><label for="companyInformationForm:companySize:0"> &lt;50</label></td>
</tr>
<tr>
<td>
<input type="radio" name="companyInformationForm:companySize" id="companyInformationForm:companySize:1" value="51-100" /><label for="companyInformationForm:companySize:1"> 51-100</label></td>
</tr>
<tr>
@rangalo
rangalo / resource-mixins.scss
Created October 26, 2015 17:49
Possible implementation on php side
@function resource_url($url) {
@return ("#{$url}");
}
@rangalo
rangalo / _type.scss
Created October 26, 2015 17:48
Usage for the fonts
// I have moved the fonts in a dedicated folder at the same level as css and img
@font-face {
font-family: 'LigatureSymbols';
src: url(resource_url('fonts/LigatureSymbols-2.11.eot'));
src: url(resource_url('fonts/LigatureSymbols-2.11.eot?#iefix')) format('embedded-opentype'),
url(resource_url('fonts/LigatureSymbols-2.11.woff')) format('woff'),
url(resource_url('fonts/LigatureSymbols-2.11.ttf')) format('truetype'),
url(resource_url('fonts/LigatureSymbols-2.11.svg#LigatureSymbols')) format('svg');
src: url(resource_url('fonts/LigatureSymbols-2.11.ttf')) format('truetype');
font-weight: normal;
@rangalo
rangalo / _form.scss
Created October 26, 2015 17:46
How to use the mixin
// usage of the mixin
select:before {
content: '';
background: $lightGrey src (resource_url('img/dropdown.png')) center center no-repeat;
background-size: 75%;
height: $baseUnit*3;
width: $baseUnit*3;
z-index: 3;
position: absolute;
@rangalo
rangalo / resource-mixins.scss
Created October 26, 2015 17:46
This mixin will be on jsf side
//-----------------------------------------------------------------------------
// resource_url function returns the parameter as url(#{resource['<parameter>']})
// and should be used instead of CSS url() or compass image_url() in JSF applications.
// Define JSF Resource Library resource['standard:
@function resource_url($url) {
@return ("\#{resource['#{$url}']}");
}