Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
ⒸⓄⒹⒺ

Gill Velleda Gonzales g1ll

💻
ⒸⓄⒹⒺ
View GitHub Profile
@g1ll
g1ll / listfolders.php
Last active Sep 15, 2019
Recursive PHP function to list folders and subforlders of a directory and returned a PHP Array.
View listfolders.php
<?php
function getFolders($dir = false) {
$server_sign = filter_input(INPUT_SERVER, 'SERVER_SIGNATURE', FILTER_SANITIZE_STRING);
$unix_server = (stristr($server_sign, "win")) ? false : true;
$slash = ($unix_server) ? "/" : "\\";
$dir = (!$dir) ? getcwd() : $dir;
$open_dir = opendir($dir);
$folders = [];
while ($item = readdir($open_dir)) {
if ($item != "." && $item != "..") {
@g1ll
g1ll / parrun.sh
Created Dec 24, 2019 — forked from precise-simulation/parrun.sh
Bash xargs script to run parallel MATLAB and Octave jobs
View parrun.sh
#!/bin/bash
#
# Bash script using xargs to run Matlab and Octave jobs in parallel.
#
n_parruns=16 # Total number of runs.
n_parproc=3 # Number of simultaneous parallel processes.
# Define Matlab/Octave executable and main m-scipt file to run.
export runcmd='/mnt/c/Octave/Octave-4.2.1/bin/octave-cli.exe'
@g1ll
g1ll / byobuCommands
Last active Aug 14, 2020 — forked from jshaw/byobuCommands
Byobu Commands
View byobuCommands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window