Skip to content

Instantly share code, notes, and snippets.

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Your text message');
# add git branch name and mark if it has unstaged changes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
evil_git_dirty() {
git_status="$(git status 2> /dev/null)"
untracked_pattern="Untracked files:"
not_staged_pattern="Changes not staged for commit"
branch_ahead="Your branch is ahead of"
@tangar76
tangar76 / win10.sh
Last active June 1, 2016 19:37
windows 10 - fix stuck start
# 1. When the Run new task dialog box opens, type 'powershell', tick the box for Create this task with administrative privileges and click OK.
sfc /scannow
# 1.1 'Windows Resource Protection found corrupt files but was unable to fix some (or all) of them' indicates a problem.
DISM /Online /Cleanup-Image /RestoreHealth
# 2nd possible fix if previous did not help. Run follow command in powershell
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
# DO NOT FORGET TO RESTART PC
git diff --name-only --diff-filter=D 0fd1ca6..master