Skip to content

Instantly share code, notes, and snippets.

View DanAtkinson's full-sized avatar
🏠
Working from home

Dan Atkinson DanAtkinson

🏠
Working from home
View GitHub Profile
@DanAtkinson
DanAtkinson / updateNpm.bat
Last active January 5, 2022 22:02 — forked from nokidding/updateNpm.bat
Windows batch file which updates npm for nvm-windows
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 (
@DanAtkinson
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.
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts http://sysctl.org/cameleon/hosts https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt https://v.firebog.net/hosts/AdguardDNS.txt https://adaway.org/hosts.txt https://v.firebog.net/hosts/Easyprivacy.txt https://v.firebog.net/hosts/Prigent-Ads.txt https://zerodot1.gitlab.io/CoinBlockerLists/hosts https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/ocsp.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/crl.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts https://hosts.ubuntu101.co.za/hosts https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/thirdparties/pgl.yoyo.org/as/serverlist https://raw.githubusercontent.com/DataMaster-2501/Da
@DanAtkinson
DanAtkinson / worldometer-covid19.js
Last active April 9, 2020 19:32
worldometer Covid-19 additions of mortality and highlighting of European nations
// ==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==
@DanAtkinson
DanAtkinson / Update.bat
Last active July 13, 2020 18:31
Updating node.js using nvm
# 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
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f
@DanAtkinson
DanAtkinson / Visual Studio solution file headers
Last active January 19, 2024 15:52 — forked from JamesSkemp/Visual Studio solution file headers
Visual Studio solution file headers - 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019, and 2022
== 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
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.
<!doctype html>
<html>
<head>
<title>Windows code sample 'hack'</title>
</head>
<body>
<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="http://lifepluslinux.blogspot.com.au/2017/01/look-before-you-paste-from-website-to.html">Suresh Alse</a>. For a little more information, see my <a href="https://danatkinson.github.io/2017/01/26/How-to-hack-a-trusting-developer-s-machine/" title="How to hack a trusting Windows developer's machine">blog post</a> at danatkinson.github.io.</p>
<code style="background-color:#eeeeee;padding:10px;">
@DanAtkinson
DanAtkinson / GetFilesOlderThan30Mins.ps1
Last active May 27, 2021 05:45
Simple Powershell script to get files older than 30 minutes. Obviously adaptable as needed.
$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
DanAtkinson / tooltipDirective.js
Created December 22, 2016 10:42
Really simple Angular tooltip directive that makes use of PNotify.
/*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
DanAtkinson / remove-accents.js
Created December 2, 2016 12:03 — forked from monkeymonk/remove-accents.js
AngularJS `removeAccents` filter
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