Skip to content

Instantly share code, notes, and snippets.

View BenPrevel's full-sized avatar

BenPrevel BenPrevel

View GitHub Profile
### GET https://www.w3.org/History/19921103-hypertext/hypertext/WWW/TheProject.html
GET https://www.w3.org/History/19921103-hypertext/hypertext/WWW/TheProject.html
### GET https://http-practice.herokuapp.com/wilders?language=PHP&page=2
GET https://http-practice.herokuapp.com/wilders?language=PHP&page=2
### POST https://http-practice.herokuapp.com/wilders
POST https://http-practice.herokuapp.com/wilders
Content-Type: application/x-www-form-urlencoded
name=Mich%20Mich&language=PHP
function hello(name : string) {
console.log("Hello " + name);
}
var firstName: string = "bob";
hello(firstName);
hello(firstName + " marley");
class Person {
name: string;
age: number;
constructor(name: string, age: number) {
this.name = name;
this.age = age;
}
tellMyName() {
function hello(name : string): void {
console.log("Hello " + name);
}
const firstName: string = "bob";
hello(firstName);
hello(firstName + " marley");
class Senpai{
public static void main(String[] args){
System.out.println("Notice me Senpai");
}
}
public class CandyCount {
public static void main(String[] args) {
double money = 12.4;
double price = 1.2;
int candies = 0;
if (money > 0 && price > 0) {
while ((money - price) >= 0) {
candies = candies +1;
@BenPrevel
BenPrevel / Java 03 : Variables
Last active November 30, 2021 09:37
Java 03 : Variables
public class Variable {
public static void main(String[] args) {
String movieName = "Indiana Jones and the Last Crusade";
boolean haveSeen = true;
int releasedDate = 1989;
float movieRate = 8.2f;
System.out.println(movieRate);
@BenPrevel
BenPrevel / Java 04 : Tableaux et itération
Created November 30, 2021 11:34
Java 04 : Tableaux et itération
public class Movies2 {
public static void main(String[] args) {
String [] movies = {"Indiana Jones and the Last Crusade", "Indiana Jones and the Temple of Doom", "Raiders of the Lost Ark"};
String [][] actorsMovies =
{{"Sean Connery", "Denholm Elliott", "Harrison Ford" },
{"Harrison Ford", "Kate Capshaw", "Jonathan Ke Quan"},
{"Harrison Ford", "Karen Allen", "Paul Freeman"}};
@BenPrevel
BenPrevel / Java 05 : Méthodes
Last active December 6, 2021 10:25
Java 05 : Méthodes
public class Decipherer {
public static String transcription(String message){
int key = message.length()/2;
String substring = message.substring (5, 5 + key);
String replace = substring.replace ("@#?"," ");
String reverseMessage = new StringBuilder(replace).reverse().toString();
return reverseMessage;
@BenPrevel
BenPrevel / 01 - Introduction aux bases de données relationnelles
Created December 12, 2021 15:34
01 - Introduction aux bases de données relationnelles
mysql> SHOW TABLES;
+-------------------------+
| Tables_in_wild_db_quest |
+-------------------------+
| school |
| wizard |
+-------------------------+
2 rows in set (0,00 sec)
mysql> DESCRIBE wizard;