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 | |
$urls[] = array( | |
"name" => "Domain 1 Name", | |
"url" => "https://domain.com" | |
); | |
$urls[] = array( | |
"name" => "Domain 2 Name", | |
"url" => "https://subdomain.domain.org" |
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
(netsh wlan show profiles) | Select-String “\:(.+)$” | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=”$name” key=clear)} | Select-String “Key Content\W+\:(.+)$” | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize | |
pause |
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 | |
// Example | |
$sma_array = simple_sma(array(3,10,11,19,18,12,6,5,9,0), 5); | |
print_r($sma_array); // Outputs 8, 13.3333, 16, 16.3333, 12, 7.6667, 6.6667, 4.6667 | |
function simple_sma($array, $days) { | |
if($days < 0) die("Days have to be higher than 0 in the simple_sma function."); | |
$array = array_values($array); |
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 | |
// was used when API address moved but apps were live on app store. | |
$ch = curl_init(); | |
$path = $_SERVER['REQUEST_URI']; | |
$path = str_replace('/api/index.php','',$path); | |
$path = str_replace('/api/','/',$path); |
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 $todayid = date("z"); // to get today's day of year | |
function dayofyear2date( $tDay, $tFormat = 'd-m-Y' ) { | |
$day = intval( $tDay ); | |
$day = ( $day == 0 ) ? $day : $day - 1; | |
$offset = intval( intval( $tDay ) * 86400 ); | |
$str = date( $tFormat, strtotime( 'Jan 1, ' . date( 'Y' ) ) + $offset ); | |
return( $str ); | |
} | |