Skip to content

Instantly share code, notes, and snippets.

View MarineLB's full-sized avatar
🍟
nom nom nom

Marine LB MarineLB

🍟
nom nom nom
View GitHub Profile
@MarineLB
MarineLB / nbmagique.php
Created November 21, 2017 22:57
Nombre magique - essai
<?php
$min = 1;
$max = 1000;
$nbRandom = round(rand($min, $max));
$nbTest = null;
$nbTrouve = null;
$nbIterations = 0;
echo "Et le nombre gagnant est ".$nbRandom."...".PHP_EOL;
@MarineLB
MarineLB / Game.vue
Created December 20, 2017 21:24
vuejs vuex test
<template>
<div>
<div class="container__game" v-if="stateSpecies != null" :class="'container__game--'+threat">
<div class="virtualpet__interface">
<header class="">
<div class="header__link" >
<router-link to="/map" class="button button--left"><img :src="'static/img/icons/worldmap.png'" alt="Retourner sur la carte"></router-link>
</div>
<div class="header__title" v-if='!isFound'>
<h1>Félicitations <br> Tu as découvert le {{ species }}!</h1>
@MarineLB
MarineLB / index.js
Created December 20, 2017 21:30
vuejs vuex test - store
//creer dossier store et mettre index.js avec export default pour vuex
import Vue from 'vue';
import VueX from 'vuex';
import axios from 'axios';
Vue.use(VueX)
const getLocalStorage = () => {
let localSpecies = []
for (var i = 0; i < localStorage.length-1; i++) {
localSpecies.push(localStorage.getItem(localStorage.key(i)));
@MarineLB
MarineLB / base.html
Created March 4, 2018 17:11
Basic structure to start an HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Titre de la page</title>
</head>
<body>
<h1>Hello World...</h1>
<p>Ready to start !</p>
// get the form element
const form = document.querySelector('form');
// execute function when form is submitted
form.addEventListener("submit", function(e) {
// prevent form submit and page refresh
e.preventDefault();
// find the submit button with class
const $submit = form.querySelector('.contact__submit');
// add the class 'clicked' to the button, to apply some nice styles