Skip to content

Instantly share code, notes, and snippets.

View mintsoft's full-sized avatar
💭
Probably alive.

Rob Emery mintsoft

💭
Probably alive.
  • UK
View GitHub Profile
@mintsoft
mintsoft / log.cpp
Created March 10, 2024 09:50
qCritical log out a stack trace from boost::stacktrace
#include <boost/stacktrace.hpp>
// .....
auto re_stacktrace = boost::stacktrace::stacktrace();
for(boost::stacktrace::frame frame: re_stacktrace) {
if(frame.empty() == false) {
qCritical("STACK -- %s %s:%d %d", frame.name().c_str(), frame.source_file().c_str(), frame.source_line(), frame.address());
}
@mintsoft
mintsoft / HMRC_IncomeTax_NIC_ExcelOnline.ts
Created August 4, 2023 13:02
Adds functions to calculate income tax and national insurance on raw income
/** @CustomFunction */
function incomeTax(pay: number): number {
var additionalTax = 0;
var higherTax = 0;
var basicTax = 0;
var personalAllowanceToRemove = Math.floor((pay - 100000) / 2);
var defaultPersonalAllowance = 12570;
@mintsoft
mintsoft / iPXE_WDS_EFI.md
Last active January 5, 2024 10:42
iPXE + WDS + EFI Boot Menu
@mintsoft
mintsoft / GetDellWarranty.gs
Last active December 19, 2019 16:42
GetDellWarranty V5 From TechDirect for GScript/Google Sheets
/*
* Returns Dell Warranty for service tag using APIKey
*
* @param {apiKey} API Key from techdirect
* @param {serviceTag} the ServiceTag desired
* @param {headers} Include headers in output
* @return The description and warranty status
*/
function getDellWarranty(clientId, clientSecret, serviceTag, headers) {
@mintsoft
mintsoft / GMail - MAAR.js
Last active March 16, 2019 16:41
GMail - HTML - Mark Page As Read
// ==UserScript==
// @name GMail - Mark Page As Read
// @namespace gmail
// @include https://mail.google.com/*
// @version 1
// @grant none
// ==/UserScript==
(function() {
'use strict';
@mintsoft
mintsoft / Screenshot.ps1
Created April 27, 2016 23:48
Screenshot.ps1
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
function screenshot([Drawing.Rectangle]$bounds, $path) {
$bmp = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($bmp)
$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$bmp.Save($path)
$graphics.Dispose()
@mintsoft
mintsoft / Win10Cleanup.ps1
Created January 23, 2016 20:34
Windows 10 annoying embedded "apps" killer
#installed packages
Get-AppXPackage | Select Name
#automatically downloaded apps when clicked:
Get-AppXProvisionedPackage -Online | Select DisplayName
#Remove Package:
Get-AppXPackage Microsoft.Office.OneNote | remove-appxpackage
#Remove Provisioned Package:
Remove-AppXProvisionedPackage -Online -PackageName (Get-AppXProvisionedPackage -Online | ? { $_.DisplayName -like "Microsoft.Office.OneNote" }).PackageName
@mintsoft
mintsoft / hack_ubuntu1204.sh
Created October 28, 2015 16:12
Ubuntu 12.04 Migrate to Bonding network configuration without a reboot
#!/bin/bash
# put new bonded configuration in interfaces.bonded and cd into /etc/network
ifdown -a; mv interfaces interfaces.old; mv interfaces.new interfaces; ifup lo; ifup bond0 & ifup eth0; ifup eth1;
use strict;
use warnings;
open INPUT, "./robtest.txt";
while(<INPUT) {
chomp;
print "line: '$_'\n";
}
#!/usr/bin/perl -w
# William Lam
# 12/10/2009
# http://engineering.ucsb.edu/~duonglt/vmware/
# http://communities.vmware.com/docs/DOC-9852
use strict;
use warnings;
use IO::Socket::SSL;
use Term::ANSIColor;