Skip to content

Instantly share code, notes, and snippets.

View MasseGuillaume's full-sized avatar

Guillaume Massé (马赛卫) MasseGuillaume

  • narrative.io
  • Montréal, Québec, Canada
  • 17:53 (UTC -04:00)
View GitHub Profile
@MasseGuillaume
MasseGuillaume / tp1.scala
Created July 7, 2012 05:30
LOG3210 - TP1
import scala.util.parsing.combinator._
object Main
{
def main(args: Array[String])
{
println(TP1.parseAll(TP1.program, args(0)))
}
}
@MasseGuillaume
MasseGuillaume / tp2.scala
Created July 7, 2012 22:55
LOG3210 - TP2
import scala.util.parsing.combinator.Parsers
import scala.util.parsing.combinator.JavaTokenParsers
object Main
{
def main(args: Array[String])
{
val arg = "( x + 0 ) - ( 1 * --x )"
TP2.parseAll( TP2.expression, arg ) match {
@MasseGuillaume
MasseGuillaume / error.sh
Created July 26, 2012 01:05
Cloudbees: Cannot deploy with SDK
bees app:deploy target/scala-2.9.1/scalakata_2.9.1-0.1-SNAPSHOT.war
# CloudBees SDK version: 0.8.1
Deploying application masgui/scala (environment: ): target/scala-2.9.1/scalakata_2.9.1-0.1-SNAPSHOT.war
2012-07-25 21:00:54,558 [main] INFO - I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
2012-07-25 21:00:54,558 [main] INFO - Retrying request
2012-07-25 21:00:54,617 [main] INFO - I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
2012-07-25 21:00:54,617 [main] INFO - Retrying request
2012-07-25 21:00:54,675 [main] INFO - I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameter

tu peux modifier et accèder le DOM produit par la template avec du code javascript

<ol id="cheminement">
	<li class="session">
		<span class="periode">Automne</span>
		<span class="annee">2009</span>
		<ul class="liste-cours">
			<li class="placeholder"></li>
 
<li draggable="true" class="cours" id="INF1005C">
<lift:surround with="cours">
<lift:bind-at name="sigle">INF1005C</lift:bind-at>
<lift:bind-at name="credits">3</lift:bind-at>
<lift:bind-at name="titre">Programmation procédurale</lift:bind-at>
<lift:bind-at name="definition">
<ul class="disponibilite">
<li>Automne</li>
<li>Hiver</li>
package ca.polymtl.log4420
package test
package systeme
import org.scalatest._
import matchers.ShouldMatchers
import selenium.{WebBrowser, Chrome}
@EquipeDeQuatre
class AfficherUaTest
@MasseGuillaume
MasseGuillaume / AkkaTest.scala
Created April 23, 2013 14:21
Akka Testkit expectMsgAllPF
implicit class ReceiveAllOf[T]( probe: TestProbe ) {
def expectMsgAllPF[T]( handlers: List[PartialFunction[Any, T]] ): List[T] = {
val messages = probe.receiveN( handlers.size )
// Accumulate result, Every handler must map to one Message
messages.foldRight( ( handlers, List.empty[T] ) ){ case ( message, ( accHandlers, res ) ) => {
val handler = accHandlers.find( _.isDefinedAt( message ) )
val newAcc = accHandlers.filterNot( _ == handler.get )
val result = handler.map( _.apply( message ) ).getOrElse( fail(s"got unexpected message $message") )
@MasseGuillaume
MasseGuillaume / a.scala
Created March 18, 2016 17:16
scalakata
import com.scalakata._
@instrument class Playground {
List(1,2,3).reverse
}
var http = require('http');
var server = http.createServer(function (i, out){
out.writeHead(200, {'Content-Type': 'application/json'});
out.end(JSON.stringify({'name': 'out'}));
})
server.listen(8080);