Skip to content

Instantly share code, notes, and snippets.

@tascrafts
tascrafts / simple_sma.php
Created May 24, 2018 14:55
Simple Moving Average function for PHP
<?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);
@tascrafts
tascrafts / default.php
Created September 19, 2019 17:26
Default HTML file with headers and bootstrap
<?php
// PHP content here.
?><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@tascrafts
tascrafts / Show Wi-Fi Passwords.ps
Last active August 20, 2024 12:14
Lists all saved wi-fi networks and passwords on Windows 10
(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
@tascrafts
tascrafts / certificate_checker.php
Created May 17, 2023 11:07
A PHP script to check and display SSL certificate expiration in Google and .ical calendars
<?php
$urls[] = array(
"name" => "Domain 1 Name",
"url" => "https://domain.com"
);
$urls[] = array(
"name" => "Domain 2 Name",
"url" => "https://subdomain.domain.org"