Skip to content

Instantly share code, notes, and snippets.

View cristianmiranda's full-sized avatar
🏡
Working from home

Cristian Miranda cristianmiranda

🏡
Working from home
View GitHub Profile
@cristianmiranda
cristianmiranda / order.logic.java
Created March 4, 2015 10:50
Validations order algorithm
int order = 0;
for (ConstraintViolation<MedicalProvider> violation : violations) {
for (int i = order; i < violations.size(); i++) {
// If constraint isn't in the expected order, maybe it's after some not excluded property
if (!medicalProvider.getValidationsOrder().get(i).equals(violation.getPropertyPath().toString())) {
boolean found = false;
for (int j = 0; j <= order; j++) {
if (medicalProvider.getValidationsOrder().get(j).equals(violation.getPropertyPath().toString())) {
found = true;
break;
00:04:38.041 [ERROR] Failed to create an instance of 'com.gwtplatform.mvp.client.DesktopGinjector' via deferred binding
com.google.gwt.core.client.JavaScriptException: (null) @com.google.gwt.core.client.impl.Impl::getHostPageBaseURL()([]): null at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.getHostPageBaseURL(Impl.java) at com.google.gwt.core.client.GWT.getHostPageBaseURL(GWT.java:98) at com.escribehost.core.client.services.ServiceModule.getApplicationPath(ServiceModule.java:28) at com.escribehost.core.client.services.com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragmen
@cristianmiranda
cristianmiranda / series_renamer.sh
Created January 19, 2015 21:22
Series Episodes renamer script
#!/bin/sh
episodes="*"
regex="Seinfeld Season ([[:digit:]]{1,2}) Episode ([[:digit:]]{1,2}) - ([a-zA-Z0-9_\& \-]*)(.mkv|.srt)"
for f in $episodes
do
if [[ $f =~ $regex ]]; then
season="${BASH_REMATCH[1]}"
episode="${BASH_REMATCH[2]}"
name="${BASH_REMATCH[3]}"