View DeferredResultSubscriber.java
import org.springframework.web.context.request.async.DeferredResult; | |
import rx.Observable; | |
import rx.Observer; | |
import rx.Subscription; | |
/** | |
* A {@link DeferredResult} that subscribes to an observable | |
* | |
* @see DeferredResult | |
*/ |
View NotIn.ts
import LodashStatic = _; | |
class NotIn { | |
static ID:string = 'notIn'; | |
static filter() { | |
return (input:any[], blacklist:any[]) => { | |
return LodashStatic.difference(input, blacklist); | |
}; | |
} |
View Range.ts
class Range { | |
static ID:string = 'range'; | |
static filter() { | |
return (num:number, offset:number = 1) => { | |
var res = []; | |
for (var i = offset; i <= num; i = i + offset) { | |
res.push(i); | |
} | |
return res; |
View WeblogicActivitiExtension
/** | |
* Weblogic ClassLoader on CDI Extension don´t localize META-INF/services necessary to load ProcessEngine. | |
* <p> | |
* This class provides an overriding extension point which uses the correct classloader, in order to instantiate | |
* a {@link org.activiti.cdi.spi.ProcessEngineLookup} | |
* </p> | |
*/ | |
public class WeblogicActivitiExtension extends ActivitiExtension { | |
public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event) { |
View PropertiesUtis.java
public class PropertiesUtis { | |
public static void copyProperties(Object fromObj, Object toObj) { | |
Class<? extends Object> fromClass = fromObj.getClass(); | |
Class<? extends Object> toClass = toObj.getClass(); | |
try { | |
BeanInfo fromBean = Introspector.getBeanInfo(fromClass); | |
BeanInfo toBean = Introspector.getBeanInfo(toClass); | |
PropertyDescriptor[] toPd = toBean.getPropertyDescriptors(); |
View update.sh
#! /bin/bash | |
declare -r MULTI_PJ_HOME='<THE_MULTI_PROJECT_ROOT_PATH>' | |
declare -r projects="<LIST_OF_MODULES_IN_RESPECT_OF_THE_MULTI_PROJECT_ROOT_PATH>" | |
for project in $projects | |
do | |
echo "================================================" | |
echo "Updating $project" | |
echo "================================================" |
View Vagrantfile
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$jdk5 = <<script | |
wget -nc "https://www.dropbox.com/s/rvhj797qe9uvetv/jdk-1_5_0_22-linux-amd64.bin?dl=0" \ | |
-O jdk-1_5_0_22-linux-amd64.bin | |
chmod +x jdk-1_5_0_22-linux-amd64.bin | |
yes | sh jdk-1_5_0_22-linux-amd64.bin | |
script |
View DateInspector.java
public class DateInspector { | |
public static boolean isLastWorkingDayOfMoth(Calendar date) { | |
// get the current date | |
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); | |
// get the calendar last day of this month | |
int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); | |
// set the current date to the last day of the month | |
cal.set(Calendar.DAY_OF_MONTH, lastDay); | |
// if it's on a weekend, transform it accordingly | |
switch (cal.get(Calendar.DAY_OF_WEEK)) { |