Skip to content

Instantly share code, notes, and snippets.

View aruizca's full-sized avatar

Angel Ruiz aruizca

View GitHub Profile
@aruizca
aruizca / updatetags.sh
Last active May 12, 2020 18:46
Bash script to update tags in an existing Git repository
#!/usr/bin/env bash
commit_hashes=($(git ls-remote --tags --refs -q | awk '{ print $1 }'))
tags=($(git ls-remote --tags --refs -q | awk '{ print $2 }' | sed 's/refs\/tags\///'))
COUNTER=0
echo "Start processing ${#tags[@]} tags"
echo "================================="
for tag in "${tags[@]}"
do

Greach 2018 awesome list

What is this?

A compilation of all the links to slides and repositories used in workshops or shown by the speakers.

Why

It can be difficult to retrieve all that material on twitter after the conference.

Contents

@aruizca
aruizca / snippet.groovy
Created July 29, 2015 23:49
Monad example from Mario Fusco's "Monadic Java" presentation but implemented in Groovy
String getCarInsuranceName(Person person) {
String insuranceName = person?.getCar()?.getInsurance()?.getName()
return insuranceName?:"Unknown"
}
@aruizca
aruizca / JSONObjectNullSpec.groovy
Created July 28, 2015 00:35
This shows the problems with the use of the JSONObject.NULL class by the Grails JSON converter
package grails.converters.tests
import grails.converters.JSON
import org.codehaus.groovy.runtime.typehandling.GroovyCastException
import spock.lang.Specification
/**
* Created by Angel Ruiz.
*/
class JSONObjectNullSpec extends Specification {
@aruizca
aruizca / jax-rs-swagger-annotation
Created October 4, 2013 03:51
This is an example about how to annotate your JAX-RS resource with Swagger annotation to generate the API documentation
/**
* Copyright 2012 Wordnik, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@aruizca
aruizca / gist:5139808
Created March 12, 2013 02:26
Detect AjaxAnywhere request at server side
...
if (AAUtils.isAjaxAnywhereRequest(request) {
// Perform request forward
} else {
// Perform response redirect
}
@aruizca
aruizca / gist:5139667
Created March 12, 2013 01:58
displaying spinner on ajax request example
var x,y;
$(function () {
$('body').mousemove(function (e) {
x = e.pageX;
y = e.pageY;
});
$(document).ajaxStart(
function (e) {
@aruizca
aruizca / gist:5080373
Created March 4, 2013 06:28
JUL to SL4J listener declaration
<!-- Jul to Slf4j Bridge Listener -->
<listener>
<listener-class>
com.nerderg.ajaxanywhere.listener.JulToSlf4jBridgeListener
</listener-class>
</listener>
@aruizca
aruizca / gist:5080167
Created March 4, 2013 05:33
AjaxAnywhere static file resolution
<servlet>
<servlet-name>AAResourcesServlet</servlet-name>
<servlet-class>com.nerderg.ajaxanywhere.servlet.StaticResourcesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AAResourcesServlet</servlet-name>
<url-pattern>/js/jquery-aa.js</url-pattern>
</servlet-mapping>
@aruizca
aruizca / gist:5080080
Created March 4, 2013 05:05
Import javascript libraries
<script src="<c:url value="/js/jquery/jquery-1.9.1.min.js"/>"></script>
<script src="<c:url value="/js/jquery-aa.js"/>"></script>