Skip to content

Instantly share code, notes, and snippets.

View tOverney's full-sized avatar
🦓

Tristan Overney tOverney

🦓
View GitHub Profile
@tOverney
tOverney / chasse2019.scala
Created October 13, 2019 14:01
Chasse 2019
val MeatPrice = 137.25D
val HipsterMarketPrice = 14.9D
val MigrosBecauseHipsterMarketDidntHaveEverything = 56.45D
val RedWineTwoBottlePrice = 33D
val ChanterellesAightss = 14D
sealed class Human(val alreadyPaid: Double)
object Human {
val values = Set(Fouki, Tristan, Gaspard, Fred, Yoann, Audrey, Ariane)
@tOverney
tOverney / chasse2018.sc
Created October 23, 2018 15:30
Chasse 2018: Homebrewed splitwise
val MeatPrice = 95.80
val HipsterMarketPrice = 66.0
val CoopBecauseHipsterMarketDidntHaveEverything = 75.3
val RedWinePackPrice = 136.8
val NbBottlesInPack = 6
val PriceForTwoRedWineBottles = 2 * RedWinePackPrice / NbBottlesInPack
val TotalPaidByTristan = HipsterMarketPrice + CoopBecauseHipsterMarketDidntHaveEverything + RedWinePackPrice
import enumeratum.{ Enum, EnumEntry }
@tOverney
tOverney / test.py
Last active December 6, 2016 13:56
from subprocess import Popen, PIPE
computerName = Popen(["scutil","--get","ComputerName"], stdout=PIPE).communicate()[0]
print "Hello " + computerName + ", how are you?"
@tOverney
tOverney / upload_to_flickr.py
Created November 13, 2016 21:28
Simple script to upload the content of a folder `images`
#! /usr/bin/python3
# -*- coding: utf-8 -*-
import wget, os, flickrapi, webbrowser
from pathlib import PurePosixPath, PosixPath, Path
def path(elems):
return "/".join(elems)
OUT_DIR = "images"
import akka.actor._
// These are the messages sent by the Scrutineer
case object VoteIsOver
case class IssueVoted(val question: String)
// These are all the messages sent by an Assembly member
case object ImHere
sealed trait VoteOption
case object Yes extends VoteOption
import java.util._
import scala.collection.mutable.MutableList
import scala.collection.mutable.Set
import scala.collection.mutable.Map
// IMPORTANT -- THIS IS INDIVIDUAL WORK. ABSOLUTELY NO COLLABORATION!!!
// - implement a (main-memory) data store with OMVCC.
// - objects are <int, int> key-value pairs.
package relation
package compiler
import scala.collection.mutable
import ch.epfl.data.sc.pardis
import pardis.optimization.RecursiveRuleBasedTransformer
import pardis.quasi.TypeParameters._
import pardis.types._
import PardisTypeImplicits._
package main.scala
object ResultsToHtmlItem extends App {
private def offset: Int => String = " " * _
sealed trait HtmlElem {
def print(indent: Int): String = ""
}
case class DtDd(dtContent: HtmlElem, ddContent: HtmlElem) extends HtmlElem {
override def print(indent: Int): String = {
@tOverney
tOverney / A - Sheeps.scala
Last active May 31, 2016 00:09
Google Code Jam 2016 (Online Qualification)
package main.scala
import scala.io.Source
object Sheeps extends App {
val fullSet = Set('0','1','2','3','4','5','6','7','8','9')
val path = "/Users/TristanO/Documents/projects/scalaFun/CodeJam/input.txt"
val lineIter = Source.fromFile(path).getLines()
val T = lineIter.next.toInt
for (i <- 1 to T) {
object Solution {
val cong = 1000000007L
def main(args: Array[String]) {
val line = scala.io.StdIn.readLine
val tokens = tokenize(line.toIterator.buffered)
//println(s"Tokens:\n$tokens\n")
val ast = parse(tokens)
//println(s"AST:\n$ast\n")