Skip to content

Instantly share code, notes, and snippets.

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

Jules Ivanic guizmaii

🏄‍♂️
View GitHub Profile
import java.io.*;
public class Terminal {
static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
public static String readString() {
String tmp = "";
try {

#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{

@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 {
@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

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
@guizmaii
guizmaii / infra-secret-management-overview.md
Created May 10, 2017 16:45 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@guizmaii
guizmaii / ExecutionContextMonitor.scala
Created June 2, 2017 11:11 — forked from atamborrino/ExecutionContextMonitor.scala
Monitor Scala's ExecutionContext / Akka Dispatcher lag (number of tasks in waiting queues)
import java.util.concurrent._
import akka.dispatch.{Dispatcher, ExecutorServiceDelegate}
import config.Config
import helpers.ScalaLogger
class ExecutionContextMonitor()(implicit metricsService: MetricsClient, config: Config) {
private val log = ScalaLogger.get(this.getClass)
private val scheduler = Executors.newSingleThreadScheduledExecutor()