Skip to content

Instantly share code, notes, and snippets.

View dlecan's full-sized avatar

Damien Lecan dlecan

View GitHub Profile
@dlecan
dlecan / gist:1133900
Created August 9, 2011 12:21
Add OpenJDK PPA
sudo add-apt-repository ppa:dlecan/openjdk
sudo apt-get update
sudo apt-get install openjdk-7-jre # or "openjdk-7-jdk" for JDK.
# Add "openjdk-7-source" to install JDK sources.
@dlecan
dlecan / gist:2966541
Created June 21, 2012 15:43
Setup 'dist' package publishing with Play Framework
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "sample"
val appVersion = "1.0-SNAPSHOT"
// Properties to add configure the new Artifact
Verifying that +dlecan is my blockchain ID. https://onename.com/dlecan
fn calculer_division(x: i32, y: i32) -> i32 {
match y {
0 => panic!("Division par 0"),
1 => x,
_ => x / y
}
}
fn main() {
let resultat = calculer_division(-4, 2);
use std::env;
fn calculer_division(x: i32, y: i32) -> i32 {
match y {
0 => panic!("Division par 0"),
1 => x,
_ => x / y
}
}
@dlecan
dlecan / main.rs
Last active December 10, 2016 20:54
use std::env;
fn calculer_division(x: i32, y: i32) -> i32 {
match y {
0 => panic!("Division par 0"),
1 => x,
_ => x / y
}
}
use std::env;
struct Division {
numerateur: i32,
denominateur: i32,
}
impl Division {
fn calculer(&self) -> i32 {
match self.denominateur {
use std::env;
struct Division {
numerateur: i32,
denominateur: i32,
}
impl Division {
fn new(x: i32, y: i32) -> Division {
Division {
use std::env;
struct Division {
numerateur: i32,
denominateur: i32,
}
impl Division {
fn new(x: i32, y: i32) -> Division {
Division {
use std::env;
struct Division {
numerateur: i32,
denominateur: i32,
}
impl Division {
fn new(x: i32, y: i32) -> Division {
Division {