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 / 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...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...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...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...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 / 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 / É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 / 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 / README.md
Last active November 23, 2022 21:03
Make that saving file in VS code triggers the return in Vim normal mode

Nota bene

You have to install the multi-command extension in VS Code, because VS Code doesn't handle internally to trigger multiple commands.

@pom421
pom421 / App.tsx
Last active November 22, 2022 23:53
Custom SWRConfig
import { SWRConfig } from "swr";
import { fetcher } from "@services/apiClient";
// Your fetcher need to throw error with an statusCode.
const MyApp = () => {
return (
<SWRConfig
value={{