Skip to content

Instantly share code, notes, and snippets.

View Myllaume's full-sized avatar

Guillaume Brioudes Myllaume

View GitHub Profile
@Myllaume
Myllaume / read_csv_file.php
Last active March 23, 2022 12:25
Lecture d'un fichier CSV en PHP
<?php
/**
* Obtenir un tableau à partir d'un fichier CSV
* @param string $path Chemin vers le fichier CSV à transformer
* @return array Tableau contenant pour chaque ligne du fichier CSV un tableau
*/
function CSV_file_to_array($path) {
$return_tab = [];
body {
counter-reset: hFirst;
}
h1 {
counter-increment: hFirst;
counter-reset: hSecond;
}
h2 {
@Myllaume
Myllaume / json_to_yaml.sh
Created March 23, 2022 12:31
Transform a YAML file into a JSON file at each edit with Nodemon
npm install -g js-yaml
npm install -g nodemon
nodemon --watch path/to/file.yml --exec 'js-yaml file.yml > file.json'
@Myllaume
Myllaume / database.ts
Created July 3, 2022 13:04
Use node-sqlite3 with Typescript
import { Database } from 'sqlite3';
import { SqliteTable, SqliteColumn } from '../types';
const db = new Database('database.db', (err) => {
if (err) {
console.log("Getting error " + err);
} else {
console.log('database ok');
}
});