Instantly share code, notes, and snippets.

🏠
Working from home

# Dan Atkinson DanAtkinson

🏠
Working from home
Last active January 5, 2022 22:02 — forked from nokidding/updateNpm.bat
Windows batch file which updates npm for nvm-windows
View updateNpm.bat
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
 REM Because NVM locks the nodejs directory as a symbolic link, you can't update npm. This script gets around that issue. REM see https://github.com/coreybutler/nvm-windows/issues/300#issuecomment-390319506 REM also see https://gist.github.com/johnmcase/d31b799b9030327091a0e74880e4c530 @echo off SETLOCAL EnableDelayedExpansion if [%1] == [] ( echo Pass in the version you would like to install, or "latest" to install the latest npm version. ) else (
Last active April 19, 2021 16:44 — forked from ScottHelme/lists.txt
My Pi-hole blocklist list. Removes 404s, empty, and erroring lists.
View lists.txt
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
Last active April 9, 2020 19:32
worldometer Covid-19 additions of mortality and highlighting of European nations
View worldometer-covid19.js
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
 // ==UserScript== // @name COVID-19 Mortality Meter // @namespace http://tampermonkey.net/ // @version 1.1 // @description try to take over the world! // @author You // @match https://www.worldometers.info/coronavirus/ // @grant none // @require https://code.jquery.com/jquery-3.4.1.min.js#sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo= // ==/UserScript==
Last active July 13, 2020 18:31
Updating node.js using nvm
View Update.bat
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
 # This is not to be used as an actual file but is more as a reminder for myself of the steps needed in the command line. # I could probably mash this into a workable file. # Get all current packages npm list -g --depth=0 # Make a note of the packages. grunt and jshint are the important ones for me. # Sometimes npm tells you that there is an update available. This can be done using the following: npm i npm
Created October 26, 2017 11:42
.NET enable and disable Fusion log
View Disable-Fusion-Log-.NET-Assembly-Binding-Logging.bat
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
 reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f
Last active November 28, 2022 08:35 — forked from JamesSkemp/Visual Studio solution file headers
Visual Studio solution file headers - 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019, and 2022
View Visual Studio solution file headers
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
 == Visual Studio .NET 2003 (DO NOT COPY THIS LINE) == Microsoft Visual Studio Solution File, Format Version 8.00 # Visual Studio .NET 2003 VisualStudioVersion = 7.1 == Visual Studio 2005 (DO NOT COPY THIS LINE) == Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 VisualStudioVersion = 8.0
Last active January 26, 2017 23:30
Example of how to lull a user into executing potentially dangerous commands into their Windows command prompt by 'injecting' hidden code using CSS.
View CommandLineHack.html
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
 Windows code sample 'hack'

Code sample

Copy and paste the below code sample into your command prompt to see your directory paged... And other stuff...

Inspiration taken from Suresh Alse. For a little more information, see my blog post at danatkinson.github.io.

Last active May 27, 2021 05:45
Simple Powershell script to get files older than 30 minutes. Obviously adaptable as needed.
View GetFilesOlderThan30Mins.ps1
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
 $fullPath = "D:\path\to\directory"$numDays = 0 $numHours = 0$numMins = 30 function getOldFiles($path,$maxDays, $maxHours,$maxMins) { $currDate = Get-Date #Get all children in the path where the last write time is greater than 30 minutes. psIsContainer checks whether the object is a folder.$oldFiles = @(Get-ChildItem $path -include *.* -recurse | where {($_.LastWriteTime -lt $currDate.AddDays(-$maxDays).AddHours(-$maxHours).AddMinutes(-$maxMins)) -and ($_.psIsContainer -eq$false)})
Created December 22, 2016 10:42
Really simple Angular tooltip directive that makes use of PNotify.
View tooltipDirective.js
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
 /*globals angular:false */ /* Tooltip directive */ (function (angular) { 'use strict'; var app = angular.module('app'); //Actions are performed in here. app.directive('tooltip', function ($sce,$compile) {
Created December 2, 2016 12:03 — forked from monkeymonk/remove-accents.js
AngularJS removeAccents filter
View remove-accents.js
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
 angular.module('utils.filters', []) .filter('removeAccents', removeAccents); function removeAccents() { return function (source) { var accent = [ /[\300-\306]/g, /[\340-\346]/g, // A, a /[\310-\313]/g, /[\350-\353]/g, // E, e /[\314-\317]/g, /[\354-\357]/g, // I, i /[\322-\330]/g, /[\362-\370]/g, // O, o