Skip to content

Instantly share code, notes, and snippets.

View guizmaii's full-sized avatar
🏄‍♂️

Jules Ivanic guizmaii

🏄‍♂️
View GitHub Profile

#TP N°1 ##Préliminaires

Creez un dossier pour y mettre vos programmes. Téléchargez le fichier Terminal.java à l'adresse suivante : https://gist.github.com/guizmaii/9773603 et sauvez-le dans le dossier que vous venez de créer. Ouvrez l'éditeur de texte et gardez sa fenêtre ouverte. Ouvrez une fenêtre de commande et dedans, allez dans le dossier que vous avez créé (avec la commande cd, par exemple cd "mes programmes").

##Exercice 1: compiler un programme

Voici le texte d'un programme:

public class BonjourNom{

import java.io.*;
public class Terminal {
static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
public static String readString() {
String tmp = "";
try {
@guizmaii
guizmaii / gist:11176512
Last active August 29, 2015 14:00 — forked from niallo/gist:3109252
Helper object that help to parse the "Link" header of the Github API v3, in JavaScript
var GithubHelper = {
/**
* You MUST include Sugar.js (http://sugarjs.com/) if you want this code works.
*
* Initial code found here : https://gist.github.com/niallo/3109252
*
* Parse the Github Link HTTP header used for pagination
*
* http://developer.github.com/v3/#pagination
package controllers
import play.api.mvc._
import scala.concurrent._
import akka.actor.{Props, Actor}
import play.api.Play.current
import play.api.libs.concurrent.Akka
import scala.concurrent.ExecutionContext.Implicits._
object Application extends Controller {

Keybase proof

I hereby claim:

  • I am guizmaii on github.
  • I am julesivanic (https://keybase.io/julesivanic) on keybase.
  • I have a public key whose fingerprint is AACA 84E5 5BD5 2415 55CA 55AD 5068 AA7B A92D E91F

To claim this, I am signing this object:

@guizmaii
guizmaii / IO.scala
Created August 18, 2016 08:32 — forked from jdegoes/IO.scala
A pedagogical implementation of the IO monad in Scala in 14 LOC
case class IO[A](unsafePerformIO: () => A) {
def map[B](ab: A => B): IO[B] = IO(() => ab(unsafePerformIO()))
def flatMap[B](afb: A => IO[B]): IO[B] =IO(() => afb(unsafePerformIO()).unsafePerformIO())
def tryIO(ta: Throwable => A): IO[A] =
IO(() => IO.tryIO(unsafePerformIO()).unsafePerformIO() match {
case Left(t) => ta(t)
case Right(a) => a
})
}
object IO {
@guizmaii
guizmaii / gist:0eafea869a268122dc3000a53cd25039
Created December 6, 2016 15:29 — forked from stevecj/gist:9ace6a70370f6d1a1511
Ruby will destructure objects that are not arrays, but respond to #to_ary
S=Struct.new(:a,:b)
ss = [S.new(1,2), S.new(3,4)]
p ss.map{|a,b| "#{a} #{b}" }
# => ["#<struct S a=1, b=2> ", "#<struct S a=3, b=4> "]
class S ; def to_ary ; to_a ; end ; end
p ss.map{|a,b| "#{a} #{b}" }
# => ["1 2", "3 4"]
@guizmaii
guizmaii / README.md
Created January 27, 2017 08:56
Export events from Logmatic.io output API

Installation

Download the index.js and the package.json files.

Then:

  • run npm install
  • edit and set the index.js with your query and your API_KEY
  • run node index.js and wait for the result

Questions & Feedbacks > @gpolaert

@guizmaii
guizmaii / GithubHelper.scala
Last active February 18, 2017 00:03
Helper object that help to parse the "Link" header of the Github API v3, in Scala
object GithubHelper {
/**
* Parse the Github Link HTTP header used for pagination
*
* http://developer.github.com/v3/#pagination
*
* Original code found here : https://gist.github.com/niallo/3109252
*
* @param linkHeader
import cats.instances.future._
import cats.instances.option._
import cats.syntax.traverse._
import cats.syntax.cartesian._
import scala.concurrent.Future
trait Guizmaii {
import scala.concurrent.ExecutionContext.Implicits.global