Skip to content

Instantly share code, notes, and snippets.

View osteel's full-sized avatar
🙂

Yannick Chenot osteel

🙂
View GitHub Profile
@ccmiller2018
ccmiller2018 / chat.sh
Created March 19, 2023 20:13
This gist gives you a great starting place to chat with ChatGPT on the command line
#!/bin/bash
# Check if input string is provided
if [ -z "$1" ]
then
echo "Please provide a string input";
exit 1;
fi
# Tell the user i am thinking
@hakre
hakre / HiddenFilesAndFolderFilterIterator.php
Created April 20, 2014 11:18
Filter recursive directory traversal and file listing in PHP with RecursiveDirectoryIterator
<?php
/**
* Class HiddenFilesAndFolderFilterIterator
*
* Under *Nix hidden files and directories start with a dot ("."). This RFI does not traverse
* hidden directories and filters hidden files from RecursiveDirectoryIterator listing.
*/
class HiddenFilesAndFolderFilterIterator extends RecursiveFilterIterator
{
@hakre
hakre / iteration-and-recursive-iteration.php
Created September 2, 2012 14:26
Iteration and Recursive Iteration Examples Code
<?php
/*
* Iteration and Recursive Iteration Examples Code
*
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php
* @author hakre <http://hakre.wordpress.com>
*/
### To have these examples to work, a directory with subdirectories is needed,
### I named mine "tree":