Skip to content

Instantly share code, notes, and snippets.

View darksh3ll's full-sized avatar

DARKSH3LL darksh3ll

  • France
View GitHub Profile
@darksh3ll
darksh3ll / font.css
Created July 2, 2018 19:28
font system
body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}
@darksh3ll
darksh3ll / introduction au terminal
Created September 4, 2018 08:55
introduction au terminal
Last login: Tue Sep 4 10:29:52 on ttys000
✝  ~  ls
Applications
Background images
Bases de données
Boostnote
Desktop
Documents
Downloads
Dropbox
@darksh3ll
darksh3ll / boucle-recursive.js
Last active September 23, 2018 14:39
multiplication recursive
function boucle(x) {
if (x >= 0) {
console.log(x);
boucle(x-1);
}
}
boucle(10);
function multiply(x,y) {
if (y < 0) {
y = -y;
x = -x;
}
if (y > 0) {
return x +multiply(x,y-1)
}else {
return 0
}
function opposite(number) {
return number *- 1
}
console.log(opposite(-14));
@darksh3ll
darksh3ll / v2.js
Last active March 15, 2019 06:11
cherche voyelle
const getCount = (str) => {
let consonne = 0
let vowelsCount = 0;
const letter = str.split('')
let voyelles = ["a", "o", "i", "e", "u"];
letter.map((letter) => {
voyelles.includes(letter) ? vowelsCount += 1 : consonne+=1
})
return `${vowelsCount} voyelles et ${consonne} consone`;
}
import React, { Component } from 'react'
const arr = [12,23,56]
class DisplayPokemon extends Component {
state = {
data:[]
}
//!Lance la function au demarrage
componentDidMount() {
this.fetchData()
@darksh3ll
darksh3ll / App.jsx
Last active November 3, 2018 09:45
Récuperer input dans le state avec une seul function
import React, { Component } from 'react';
import './App.css';
class App extends Component {
state = {
nom:"",
email:""
};
handleSubmit = () => {
@darksh3ll
darksh3ll / App.js
Last active December 1, 2018 08:29
axios et componentDidmount
retrieveData = async () => {
// config url
const url ="";
const data = await axios.get(`${url}`);
console.log(data);
};
componentDidMount() {
this.retrieveData();
@darksh3ll
darksh3ll / phraseCapitalize.js
Created November 4, 2018 11:35
mais les 1 er lettre en majuscule sur une phrase
function lettreCapitalize(str) {
const arr = str.split(" ");
const arrCapitalize = arr.map(str => str.charAt(0).toUpperCase() + str.slice(1));
return arrCapitalize.join(" ")
}