Skip to content

Instantly share code, notes, and snippets.

Working from home

Dan Atkinson DanAtkinson

Working from home
View GitHub Profile
DanAtkinson / updateNpm.bat
Last active January 5, 2022 22:02 — forked from nokidding/updateNpm.bat
Windows batch file which updates npm for nvm-windows
View updateNpm.bat
REM Because NVM locks the nodejs directory as a symbolic link, you can't update npm. This script gets around that issue.
REM see
REM also see
@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 (
DanAtkinson / lists.txt
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
DanAtkinson / worldometer-covid19.js
Last active April 9, 2020 19:32
worldometer Covid-19 additions of mortality and highlighting of European nations
View worldometer-covid19.js
// ==UserScript==
// @name COVID-19 Mortality Meter
// @namespace
// @version 1.1
// @description try to take over the world!
// @author You
// @match
// @grant none
// @require
// ==/UserScript==
DanAtkinson / Update.bat
Last active July 13, 2020 18:31
Updating node.js using nvm
View Update.bat
# 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
View Disable-Fusion-Log-.NET-Assembly-Binding-Logging.bat
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f
DanAtkinson / Visual Studio solution file headers
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
== 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
DanAtkinson / CommandLineHack.html
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
<!doctype html>
<title>Windows code sample 'hack'</title>
<h1>Code sample</h1>
<p>Copy and paste the below code sample into your command prompt to see your directory paged... And other stuff...</p>
<p>Inspiration taken from <a href="">Suresh Alse</a>. For a little more information, see my <a href="" title="How to hack a trusting Windows developer's machine">blog post</a> at</p>
<code style="background-color:#eeeeee;padding:10px;">
DanAtkinson / GetFilesOlderThan30Mins.ps1
Last active May 27, 2021 05:45
Simple Powershell script to get files older than 30 minutes. Obviously adaptable as needed.
View GetFilesOlderThan30Mins.ps1
$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)})
DanAtkinson / tooltipDirective.js
Created December 22, 2016 10:42
Really simple Angular tooltip directive that makes use of PNotify.
View tooltipDirective.js
/*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) {
DanAtkinson / remove-accents.js
Created December 2, 2016 12:03 — forked from monkeymonk/remove-accents.js
AngularJS `removeAccents` filter
View remove-accents.js
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