Skip to content

Instantly share code, notes, and snippets.

@phraemer
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
View frankensign.cpp
#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
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)
View sortBy.cpp
#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
phraemer / print_clsid_guid.cpp
Created April 10, 2019 12:46
Print CLSID as GUID string
View print_clsid_guid.cpp
#include <iostream>
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef unsigned char BYTE;
struct GUID {
DWORD Data1;
WORD Data2;
WORD Data3;
@phraemer
phraemer / deleteRemoteMergedBranches.sh
Created October 25, 2016 08:06
Script deletes any merged remote branches after confirmation
View deleteRemoteMergedBranches.sh
#!/bin/bash
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]$ ]]
View gist:7069583
import processing.video.*;
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;