Skip to content

Instantly share code, notes, and snippets.

View FranckSilvestre's full-sized avatar

Franck Silvestre FranckSilvestre

View GitHub Profile
@FranckSilvestre
FranckSilvestre / PionSpecification.groovy
Created November 13, 2012 16:33
Spécification basique avec Spock
package chess
import spock.lang.Specification
class PionSpecification extends Specification{
def "deplacement du pion"() {
expect:
new Pion(positionHorizontale: "a", positionVerticale: 2,
@FranckSilvestre
FranckSilvestre / PionSpecification2.groovy
Created November 14, 2012 08:32
Easy data driven with Spock
package chess
import spock.lang.Specification
import spock.lang.Unroll
import static chess.PieceCouleur.BLANC
import static chess.PieceCouleur.NOIR
class PionSpecification2 extends Specification {
@Unroll
@FranckSilvestre
FranckSilvestre / PionSpecification3.groovy
Created November 14, 2012 08:52
Stimule and responses with Spock
package chess
import spock.lang.Specification
import spock.lang.Unroll
import static chess.PieceCouleur.BLANC
import static chess.PieceCouleur.NOIR
class PionSpecification3 extends Specification {
@Unroll
@FranckSilvestre
FranckSilvestre / EchiquierSpecification2.groovy
Created November 14, 2012 10:23
Interaction test exemple
package chess
import spock.lang.Specification
import static chess.PieceCouleur.BLANC
import static chess.PieceCouleur.NOIR
class EchiquierSpecification2 extends Specification {
Echiquier echiquier = new Echiquier()
IPiece piece = Mock()
@FranckSilvestre
FranckSilvestre / ReleveNotesEndpoint.java
Created March 27, 2013 17:10
Exemple of Spring WS EndPoint using @XPathParam annotation
package iaws.relevenotes.ws.contractfirst;
import iaws.relevenotes.domain.Evaluation;
import iaws.relevenotes.domain.nomenclature.AnneeScolaire;
import iaws.relevenotes.domain.nomenclature.Niveau;
import iaws.relevenotes.domain.nomenclature.Semestre;
import iaws.relevenotes.services.ReleveNoteService;
import org.springframework.ws.server.endpoint.annotation.*;
import org.w3c.dom.Element;
@FranckSilvestre
FranckSilvestre / MembreTests.groovy
Last active December 15, 2015 12:49
Testing constraints in Grails version 2.1.1 vs version 2.1.2
void testConstraints() {
//...
Membre toto = new Membre()
// in version 2.1.2 or sup
assert !toto.validate()
assert "nullable" == toto.errors["prenom"].code
assert "nullable" == toto.errors["nom"].code
@FranckSilvestre
FranckSilvestre / pom.xml
Last active December 15, 2015 13:08
Exclusions of old xml apis from jaxen
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
@FranckSilvestre
FranckSilvestre / OSMSearchTest.groovy
Created March 31, 2013 16:38
OpenStreetMap search with Groovy HTTPBuilder
package osm
import groovyx.net.http.ContentType
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method
/**
*
* @author franck Silvestre
*/
@FranckSilvestre
FranckSilvestre / Cours.groovy
Last active December 16, 2015 06:49
GORM inheritance simple exemple
package demo
class Cours {
String name
static hasMany = [users:User]
static constraints = {}
}

Hopefully this benefits others with the same problem.

Problem

Displaying your Twitter tweets on your Google Sites website is difficult!
Google Sites filters your HTML code and doesn't allow you to add your own JavaScript code, therefore restricting you from adding any of the many existing Twitter widgets that exist today, including Twitter's very own.

The Google Gadgets directory contains a Twitter gadget called Twit. This is the gadget I was using in the past.
It uses http but Google Sites uses https, therefore this gadget is considered as insecure content and is not displayed by default on certain browsers (e.g. Chrome browser). Instead the user is asked if they want to display insecure content and are recommended not to. Now your visitors will think your site hosts malicious content and they can't easily read your tweets.