Skip to content

Instantly share code, notes, and snippets.

@burgiuk
burgiuk / phplogrotate.cmd
Created March 15, 2017 16:05
Batch script to rotate PHP logs
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SET logPath=c:\php\logs\
SET currentLog=PHP54_errors.log
FOR /F %%A IN ('WMIC OS GET LocalDateTime ^| FINDSTR \.') DO @SET B=%%A
MOVE %logPath%%currentLog% %logPath%%B:~0,4%-%B:~4,2%-%B:~6,2%.log
@burgiuk
burgiuk / urlcheck.ps1
Last active March 20, 2019 15:11
PowerShell script to check urls
$siteURL='http://example.com/'
# Set file name
$File = '.\urls.txt'
# Process lines of text from file and assign result to $NewContent variable
$NewContent = Get-Content -Path $File |
ForEach-Object {
# First we create the request.
$HTTP_Request = [System.Net.WebRequest]::Create($siteURL + $_)
<?php
function foo(){
// Stuff
$output = array(
'size'=>12-$size,
'colour'=>$colour,
'hostname' => $hostname
)