Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RobinPourtaud
RobinPourtaud / ListFileHtml.php
Last active April 11, 2020 11:11
A simple function that use the content of every files in a folder and show it in the final html file (between <script> or <style> if js or css).
<?php
//@author Robin Pourtaud <robin@pourtaud.fr>
//The link function($directory) echo the content of every file in the folder in the final html output.
//For css files, the content will be display between <style></style>
//For js files, the content will be display between <script></script>
function link($directory){
$d = array_diff(scandir($directory), array('..', '.'));
foreach ($d as $entry) { //For everyfile
@RobinPourtaud
RobinPourtaud / Readcsvline.java
Created January 14, 2020 17:43
A trivial example to demonstrate how to read an external file lines (CSV, txt...) and transfer these in a new ArrayList.
import java.util.ArrayList;
import java.util.Scanner;
import java.io.File;
class ReadCSVLine{
public static void main(String[] args){
ArrayList<String> lines = new ArrayList<String>();//New tab
try{
Scanner scanner = new Scanner(new File("a.csv"));//A txt file or any line by line file can work