This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b64toBlob(b64Data, contentType, sliceSize = 512) { | |
contentType = contentType || ''; | |
sliceSize = sliceSize || 512; | |
let byteCharacters = atob(b64Data); | |
let byteArrays = []; | |
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) { | |
let slice = byteCharacters.slice(offset, offset + sliceSize); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// COMMENTAIRE TECHNIQUE | |
// Si on ne donne pas un Promise.resolve() en valeur initiale, le "accPromise.then()" ne peut | |
// pas fonctionner car then n'est pas une fonction sur le tableau sur lequel on applique reduce() | |
// Retourner buildPromise permet de lui faire prendre la place de AccPromise. | |
// Pour autant cette ligne execute aussi la promesse et c'est parce que AccPromise est | |
// devenu la promesse qu'on attends sa résolution pour rentrer dans le then. | |
buildPromise(data, tableAbbreviation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const timeout = setTimeout(() => { | |
console.log("executé après 5 sec") | |
},5000) | |
setTimeout(() => { | |
console.log(Math.ceil((timeout._idleStart + timeout._idleTimeout)/1000 - process.uptime())); | |
}, 3000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
'apache2': | |
ensure => present, | |
#name => 'apache2', | |
#provider => apt | |
} | |
package { | |
'php7.3': | |
ensure => present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$permA = 1; | |
$permB = 2; | |
$permC = 4; | |
$permD = 8; | |
$permE = 16; | |
$permF = 32; | |
// Malgré le '|' c'est un set de permissions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Il faut ET la permission 1 (OU la permission 2 ET la permission 4) | |
// ET la permission 3 | |
$permissions = [ | |
'and' => [ | |
'permission' => [ | |
'name' => $permission1, | |
'or' => [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- PHP | |
- Symfony var-dumper : le var-dumper de Symfony, utile pour debug | |
- https://github.com/symfony/var-dumper | |
- https://packagist.org/packages/symfony/var-dumper | |
- Javascript | |
- Turbolinks : Accélère le chargement des pages en chargeant les pages en ajax | |
- https://github.com/turbolinks/turbolinks | |
- Vidéo Grafikart : https://www.youtube.com/watch?v=CjZnG_X85ww | |
- Tui Editor : Editeur WYSIWYG Markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
hardhat: | |
image: node:16 | |
container_name: hardhat | |
working_dir: /home/node/app | |
volumes: | |
- ./:/home/node/app | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.5.0 <0.9.0; | |
import "@openzeppelin/contracts/utils/Strings.sol"; | |
contract Test { | |
uint256 public value; |
OlderNewer