Skip to content

Instantly share code, notes, and snippets.

phraemer / frankensign.cpp
Created November 8, 2023 12:18
A wrapper for inserting missing args to signtool. E.g. PACE wraptool does not pass /fd
#include <iostream>
#include <fstream>
#include <vector>
int main(int argc, char* argv[])
// Print out the build date and time
std::cout << "frankensign build: " << __DATE__ << " " << __TIME__ << std::endl;
std::cout << "called with args: " << std::endl;
phraemer / sortBy.cpp
Last active November 9, 2020 09:44
My C++ implementation of a method similar to the Clojure function sort-by (see gist comment below for Clojure example)
#include <algorithm>
#include <tuple>
#include <vector>
#include <iostream>
#include <iterator>
// Returns a sorted sequence of the items in collection,
// where the sort order is determined by comparing keyFn(item).
// keyFn should take const T::value_type& as it's argument and
// return a std::tuple containing types that work with the < operator
phraemer / print_clsid_guid.cpp
Created April 10, 2019 12:46
Print CLSID as GUID string
#include <iostream>
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef unsigned char BYTE;
struct GUID {
DWORD Data1;
WORD Data2;
WORD Data3;
phraemer /
Created October 25, 2016 08:06
Script deletes any merged remote branches after confirmation
branchesToDelete=`git branch --merged | egrep -v "(^\*|master)"`
echo "The following branches will be deleted..."
echo ${branchesToDelete}
read -p "Are you sure? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
import java.util.*;
class Visual {
public String m_file;
public boolean m_image;
public Visual( String file, boolean image ) {
m_file = file;
m_image = image;