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 | |
// A Random Array of Random | |
FUNCTION R(){$N=0;FOR($I=1;$I<=64;$I++){$N.=rand(0,1);} | |
RETURN $N;}FOR($I=1;$I<=RAND(0,16);$I++){$A[R()]=R();} | |
print_r($A); | |
// http://sandbox.onlinephpfunctions.com/code/271c6c02aa703dca78ae00d8a00da4aae7181baa | |
?> |
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 | |
# --------------------------------------------------------------------------------------- | |
# install_iorpi.sh - A BASH shell script for Easy installation of io.js on a Rasberry Pi | |
# --------------------------------------------------------------------------------------- | |
PROGNAME=${0##*/} | |
VERSION="0.1.1" | |
clean_up() { # Perform pre-exit housekeeping | |
return |
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
# Remove desktop.ini & thumbs.db from all sub-directories. | |
del /s /q /f /a "z:\your_dir\desktop.ini" | |
del /s /q /f /a "z:\your_dir\thumbs.db" |
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 | |
/* | |
/* Takes an array of checklist elements from a form and converts it all to a PDO SQL Insert Statemet. | |
* This was saved from a project where the following code was no longer being used. | |
* It won't do anything without proper input. I put this here as a reference on how to build PDO SQL statements from PHP Arrays. | |
*/ | |
if (isset($_REQUEST['vehicleChecklistForm']) && !empty($_REQUEST['vehicleChecklistForm'])) { //Checks if action value exists |
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 | |
// Sample PHP function that Returns True if the Current Time is between the Start and End hours.. | |
$ban_start = 19; // Clients not allow to login starting this hour | |
$ban_end = 7; // Clients allowed to log back in starting this hour | |
$currentHour = date('H'); |
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
var ids=[], names=[], notfound=[]; | |
$("input[id^='myPrefix_'], textarea[id^='myPrefix_'], select[id^='myPrefix_']").each(function(){ | |
ids.push(this.id); | |
// console.log(this.id); | |
}); | |
$("input[name^='myPrefix_'], textarea[name^='myPrefix_'], select[name^='myPrefix_']").each(function(){ | |
names.push(this.name); | |
// console.log(this.name); |
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 | |
// Random time delay before next execution. | |
// Stores the next time in a file. | |
// Time is read from this file and compared against current time. | |
// If time has passed, perform another random delay between 1-59 seconds before execution. | |
$timeFile = 'nexttime.txt'; | |
// $timeFile = dirname(__FILE__).'/nexttime.txt'; // Use this line for when running from CRON. | |
$minDelayMins = 1; | |
$maxDelayMins = 5; |
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 | |
ini_set('max_execution_time', 0); | |
header( 'Content-type: text/html; charset=utf-8' ); // Stream output | |
echo '<div id="o"></div> | |
<script> function u(m){var e = document.getElementById("o");e.innerHTML=m;} </script>'; | |
$startTime = time(); | |
define('DB_HOST','localhost'); | |
define('DB_NAME','mytestdb'); | |
define('DB_USER','username'); |
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 personHeightOptions(){ | |
$itotal = 95; $r = ''; | |
for($foot=7;$foot>=3;$foot--){ | |
for($inches=11;$inches>=0;$inches--){ | |
if($inches==0){ | |
$r .= "<option value='$itotal'> $foot' 0\" </option>"; | |
}else{ | |
$r .= "<option value='$itotal'> $foot' $inches\" </option>"; |
OlderNewer