Skip to content

Instantly share code, notes, and snippets.

@rangalo
rangalo / Divide.java
Created August 22, 2010 10:13
Division without / operator
class Divide {
public static int divide(int dividend, int divisor) throws Exception {
int result = 0;
int sign = 1;
if (divisor == 0) {
System.out.println("Divide by 0 error");
throw new Exception("Divide by 0");
}
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 / jcrop.js
Last active January 31, 2016 14:09
bind jcrop
$('body').on('click', '#IdWhereYouWatJcropt', function(e) {
bindJCrop($this);
});
@rangalo
rangalo / uploadButtonBind.js
Last active January 28, 2016 12:06
upload button bind
$("#profileImage").on ('mouseenter' , (function(e) {
$("#imgUploadButton").fadeIn();
});
@ECHO off
:AGAIN
echo "Checking internet connection ..."
ping "www.google.com" -n 1 -w 1000 >NUL
if errorlevel 1 goto AGAIN
echo "You are connected"
<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;