This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ApplicationContext getApplicationContext(HttpSessionEvent event){ | |
ServletContext servletContext = event.getSession().getServletContext(); | |
ApplicationContext context = (ApplicationContext) servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); | |
return context; | |
} | |
public void sessionCreated(HttpSessionEvent event) { | |
TestService testService = (TestService) getApplicationContext(event).getBean("testService"); | |
//.... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.util.GroovyTestCase | |
//múltiplos de 3 > "Fizz", múltiplos de 5 > "Buzz", múltiplos de 3 y 5 > "FizzBuzz" | |
class FizzBuzz extends GroovyTestCase{ | |
void testSiNoCoincideDevuelveElNumero(){ | |
assertEquals("1", fizzBuzz(1)) | |
} | |
void testSiEsMultiploDe3DevuelveFizz(){ | |
assertEquals("Fizz", fizzBuzz(9)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create the app: | |
# grails create-app myapp | |
Write your code and test locally: | |
# grails run-app | |
Generate the application WAR file: | |
# grails war | |
Deploy the war to the Stax Cloud: | |
# stax app:deploy -a username/appid myapp.war |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LaunchRockService { | |
def emails | |
def getEmailsFromCSV(csv) { | |
def emails = [] | |
def lines = csv.split('\n') | |
lines.each{ | |
def email = it.split(',')[1] | |
emails << email.replaceAll('"','') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Estoy empanado! XD | |
Había pasado una Spec de un controller de unit a integration, porque lo que estoy testeando en cuestión tira de un criteria por debajo y blablabla... | |
Pues resulta que le había dejado las anotaciones: | |
@TestMixin(GrailsUnitTestMixin) | |
@TestFor(MiController) | |
Tras ejecutarse ese test junto al resto #acascala los métodos inyectados por GORM, también los toCsvReader inyectado a las clase String por el plugin csv resultando en un bonico groovy.lang.MissingMethodException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from selenium import webdriver | |
from selenium.webdriver.support import ui | |
from selenium.common.exceptions import NoSuchElementException, TimeoutException | |
def create_browser(): | |
profile = webdriver.FirefoxProfile() | |
profile.set_preference('permissions.default.image', 2) | |
profile.update_preferences() | |
return webdriver.Firefox(profile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qué útil encontronazo ese apartado sobre venta de negocio. esto es una manifestación | |
de que hacia entender principal estos temas se ha de haber un regla de investigación oportuno, | |
capacidad de escritura que obtenga ser de posible perspicacia obstáculo sin derribar en la estupidez, | |
y también de todo esto que obtenga ser una vía intacto de sugestión. mis acatamientos hacia su trabajo | |
y que extiendan así. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alberto Molpeceres (@molpe) | |
Diego Mariño (@diegomarino) | |
Roberto Abizanda (@rabizanda) | |
Pablo Santos (@psluaces) | |
Jorge Jimenez (@semurat) | |
Pablo Jimeno (@pablojimeno) | |
Daniel Twal (@danieltwal) | |
Laura Lacarra (@LauraLacarra) | |
Mario Camou | |
Fernando Sola (@Mr_Solo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Parche para el tranvía, que la latitud y longitud está al revés... | |
if(url == 'http://www.zaragoza.es/trafico/estado/transporte/tranviawgs84.json'){ | |
var lat = feature.geometry.coordinates[1]; | |
var lon = feature.geometry.coordinates[0]; | |
}else{ | |
var lat = feature.geometry.coordinates[0]; | |
var lon = feature.geometry.coordinates[1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@torresburriel | |
@molpe | |
@juanriaza | |
@GonValv | |
@jrubr | |
@ydarias | |
@rabizanda | |
César Laso | |
@cgcerro | |
@capitangolo |
OlderNewer