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
/** | |
* LCRscrollingText jquery plugin | |
* @description Left Center Right, with center vertical scrolling text using a ul | |
* @author Jim Kinsman | Paul Kulp | InterVarsity Christian Fellowship (intervarsity.org) | |
* @version 1.1.0 | |
* @example | |
* JAVASCRIPT: | |
* With html already defined: | |
* | |
* $('#scrolling_text_container').LCRscrollingText(); |
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 | |
namespace Todo; | |
// Data Access Object | |
abstract class DAO{ | |
protected array $row = []; | |
public const KEYS = []; | |
protected static string $table = ''; | |
public static function SetTable(string $table){ |
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 | |
function strip_unsafe_fnchars($input){ | |
return str_replace(['#','|','`','+','@',':','"',"'",'!','$',' ','/','\\', | |
'?','*','>','<','{','}','%'],'', $input); | |
} |
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 | |
$date = $argv[1] ?? null; | |
$curdate = $argv[2] ?? 'now'; | |
if (empty($date)){ | |
die('Date: '.$date.' is invalid. Use first argument for date of birth and second argument for date to calculate from like:'. | |
"\nphp birthday.php \"Nov 1, 1984\" \"Mar 1, 2004\""."\n"); | |
} | |
try{ |
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 | |
$opts = getopt('bfsvd:n:h', ['break','silent','verbose','dir:','name:','files','help']); | |
$helpstr = <<<EOT | |
Find Folder will find folders named anything. | |
php {$argv[0]} --dir /path/to/search/for/folders -n=foobar | |
Options: | |
-d, --dir Specify directory to search (recursively). | |
-n, --name Search by folder name (-n=foobar). | |
-v, --verbose Turn Verbosity on | |
-s, --silent Make as silent as possible except final result. |
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
#!/bin/bash | |
find -iname "*.php" -print0 | xargs -0 -n1 php -l 2>&1 |
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 | |
$opts = getopt('s:f:h', ['file:','string:','help']); | |
var_dump($opts); | |
$helpstr = <<<EOD | |
Description: Sum all the values given in either the file or string. | |
Usage: php {$argv[0]} OPTIONS | |
OPTIONS |
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 | |
$opts = getopt('lhc:v::', ['convert:','loop','ls', 'help']); | |
$helpstr = <<<EOT | |
Slash will convert strings/paths with / to \ and vice versa. | |
ie. try | |
C:\\Users\\relipse\\AppData\\Local\\JetBrains\\Toolbox\\apps\\PhpStorm\\ch-0\\221.5080.224\\bin\\phpstorm64.exe | |
or | |
/c/path/to/file | |
php {$argv[0]} | |
Options: |
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
/** | |
* Generate an array of English requirements from the html element validation | |
* @param $element | |
* @returns {*[]} | |
*/ | |
const generateRequirementsFromHtmlValidation = function($element){ | |
var min = null; | |
var max = null; | |
var minlength = null; | |
var maxlength = null; |
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
/** | |
* dirlist | |
* A program to list files in a directory with some information as fast as possible. | |
* Useful for directories with 500,000 files. | |
* | |
* @date 2023-10-23 | |
* @author relipse | |
*/ | |
#include <sys/stat.h> | |
#include <time.h> |