Skip to content

Instantly share code, notes, and snippets.

View pom421's full-sized avatar
🦊
Yes, What's happening?

Pierre-Olivier Mauguet pom421

🦊
Yes, What's happening?
View GitHub Profile
@pom421
pom421 / keybindings.json
Created November 23, 2022 21:06
Capslock act as Esc in VS Code
{
"key": "capslock",
"command": "extension.vim_escape",
"when": "editorTextFocus && vim.active && !inDebugRepl"
}
@pom421
pom421 / Étapes pour la fusion de fronts Egapro.md
Last active February 2, 2023 14:28
Reste à faire fusion des fronts

Étapes pour la fusion de fronts Egapro

  • Migration des pages Mon espace dans app
    • utiliser useUser pour l'accès à l'authentification
    • dsfr (faisable car les pages sont simples et surtout accessibles aux membres du staff)
  • Passage de la Consultation de l'index en DSFR (devrait être assez rapide) + homogénéité des headers et footer avec la Repeq
  • Migration des pages Simulateur dans app
    • v1. Ajouter le simulateur dans app.
      • migrer les routes de React Router en routes Next
  • créer un layout pour les pages de simulateur (avec header et footer unifié avec la Repeq)
@pom421
pom421 / tuple.ts
Last active December 29, 2022 12:35
Cast as a value of a tupe
/**
* Takes a string and returns it as an element of a tuple.
*
* In case of invalid value, returns default value if there is one, otherwise throw an error.
*/
export const castAsTupleOption = <Tuple extends readonly string[]>(
options: Tuple,
value: string | undefined,
defaultValue?: Tuple[number],
): Tuple[number] => {
@pom421
pom421 / contracts...Whiltelist.sol
Created February 7, 2023 09:18
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Whitelist
* @dev
*/
contract Whitelist {
@pom421
pom421 / contracts...exoCyril.sol
Created February 8, 2023 00:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract Storage {
@pom421
pom421 / contracts...Epargne.sol
Created February 8, 2023 19:25
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
/**
* Compte épargne
*
* Cf. aussi Ownable de OpenZeppelin
*/
contract Epargne {
@pom421
pom421 / contracts...Guess.sol
Created February 9, 2023 01:05
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.18;
/**
* Guess a word with a clue.
*/
contract Guess {
address owner;
string mysteryText;
@pom421
pom421 / contracts...ExternalStorage.sol
Created February 9, 2023 23:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.18;
import "./1_Storage.sol";
interface IStorage {
function store(uint256 num) external ;
function retrieve() external view returns (uint256);
}
@pom421
pom421 / contracts...Heritage.sol
Created February 9, 2023 23:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.18;
/**
*
*/
contract ParentContract {
uint256 internal sensDeLaVie = 42;
@pom421
pom421 / contracts...corrections...Deviez2.sol
Created February 9, 2023 23:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.18;
import "@openzeppelin/contracts/access/Ownable.sol";
contract epargne is Ownable {
string private mot;
string public indice;
address public gagnant;
mapping(address=>bool) played;
address[] public players;