I've moved this to a repo as it's easier to see what's going on:
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
#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()); | |
} |
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
$pinvokeCode = @" | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Collections.Generic; | |
namespace Resolution | |
{ | |
[StructLayout(LayoutKind.Sequential)] | |
public struct DEVMODE1 | |
{ | |
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] |
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
/** @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; |
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
#To add more commands, hack them into the $commands array: | |
$commands = @( | |
@{"cmd" = "D:\Documents\Powershell\battwo.bat"; "args" = "yo"}, | |
@{"cmd" = "D:\Documents\Powershell\batone.bat"; "args" = "yo2"} | |
); | |
$jobs = @(); | |
foreach($cmd in $commands) { | |
$startinfo = new-object System.Diagnostics.ProcessStartInfo | |
$startinfo.FileName = $cmd.cmd; |
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
/* | |
* 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) { |
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 GMail - Mark Page As Read | |
// @namespace gmail | |
// @include https://mail.google.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; |
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
#!/bin/bash | |
[[ -n "${1}" ]] && openssl x509 -in <( echo "GET /" | openssl s_client -connect ${1}:443 2>&1 | grep -A 65535 'Server certificate' | tail -n+2 | grep -B 65535 'END CERTIFICATE' ) -noout -text -purpose |
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
#!/bin/bash | |
[[ -z "$1" ]] && echo "Please specify a .pfx file!" && exit 1; | |
#combined format: | |
openssl pkcs12 -in "$1" -out "${1%.pfx}.key_cert.pem" -nodes | |
#extract certificate/public key | |
openssl x509 -in "${1%.pfx}.key_cert.pem" -out "${1%.pfx}.cert" |
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
[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() |
NewerOlder