Skip to content

Instantly share code, notes, and snippets.

View Davidegloh's full-sized avatar

Davidegloh Davidegloh

View GitHub Profile
@Davidegloh
Davidegloh / loopsSolidity.sol
Created August 14, 2021 18:28
[Loops-Solidity]#loops
//Loops
//While loop
pragma solidity 0.7.5;
contract HelloWorld {
@Davidegloh
Davidegloh / controlFlow.sol
Created August 14, 2021 18:26
[ControlFlow-Solidity]#controlFlow
//Control Flow (if, else)
pragma solidity 0.7.5;
contract HelloWorld {
// state variables
string message ; // message will have the value of _message
constructor(string memory _message){
message = _message;
}
@Davidegloh
Davidegloh / pureAndViewFunctions.sol
Last active August 14, 2021 18:23
[Pure and view functions-Solidity]
//Pure fonction = that doesn't interact with other state variable
//View fonction = that interacts (retrieve) with something else such as state variable but isn't allowed to change the state variable.
@Davidegloh
Davidegloh / Types&VariablesSolidity.sol
Last active September 6, 2021 12:24
[Types and Variables-Solidity]#variables #solidity
// JS is an untyped language
var a = 1;
var b = "Hello";
var c = false;
var d = 2.5;
// Solidity uses a typed language
int a = -1; // int means "signed integer It can be positive and negative nb
uint aa = 2; //uint means "unsigned "integer" can only nb >= 0
@Davidegloh
Davidegloh / helloWorld.sol
Last active August 14, 2021 18:19
[function HelloWorld-Solidity] #helloWorldSolidity
pragma solidity 0.7.5;
contract HelloWorld {
function hello() public pure returns(string memory){
return "Hello World";
}
@Davidegloh
Davidegloh / nav-amap.js
Created July 21, 2021 15:33
[nav-bar AMAP] #navbar
import React from 'react';
// import PropTypes from 'prop-types';
import 'semantic-ui-css/semantic.min.css'
import { Icon, Input } from 'semantic-ui-react';
import './styles.scss';
const Recettes = () => (
<section className="recettes">
<h1 className="page-title">Recettes</h1>
@Davidegloh
Davidegloh / monpremiermap.js
Created July 14, 2021 22:03
[mon premier map]#map
import { useState } from "react";
import Item from "./Components/Item/Item";
function App() {
const [dataArr, setdataArr] = useState([
{nom: "David" },
{nom: "Burger" },
{nom: "King" },
]);
@Davidegloh
Davidegloh / toggle.js
Created July 13, 2021 20:30
[toggle]#toggle
import { useState } from "react";
import Item from "./Components/Item/Item";
function App() {
const [toggle, setToggle] = useState(true);
const changeState = () => {
setToggle(!toggle);
};
@Davidegloh
Davidegloh / photo-dans-react.js
Created July 10, 2021 13:44
[photo dans react]#photoreact
// Si je veux télécharger la photo et l'avoir dans mes données, je la met dans le dossier du composant en question. Dans cette exmeple
//s'agit de "Item".
import { useState } from 'react';
import './item.css';
//J'importe la photo à cet endroit
import Ethereum from './Ethereum.jpg';
function Item(){
@Davidegloh
Davidegloh / UseState.js
Created July 8, 2021 16:59
[UseState]#UseState
//Le State sont les données de mon composant.