Skip to content

Instantly share code, notes, and snippets.

@hempnall
hempnall / Graph QML
Created October 3, 2019 20:42
Basic Graph with Qt Data Visualisation
import QtQuick 2.12
import QtQuick.Window 2.12
import QtDataVisualization 1.2
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.0
Window {
visible: true
width: 640
height: 480
MYLIST = one two three one two three
YOURLIST = $(filter-out two, $(MYLIST) )
all:
echo $(YOURLIST)
@hempnall
hempnall / gist:97c6bd3cb3e0ce283461463160236de5
Last active April 13, 2019 05:20
autounattend.xml (excerpt)
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>100</Size>
<Type>Primary</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
#include <iostream>
#include <map>
using namespace std;
#define MILLION 1000000
uint64_t collatz_func( uint64_t num )
{
if (num % 2 == 0) {
return num / 2 ;
@hempnall
hempnall / README.md
Last active June 1, 2020 16:48
Wix Installer with GUI

Creating a Wix Installer with GUI

Within the <Product> tag, add a property

<Property Id='MOTTO' Value="The quick brown fox jumped over the lazy dog" />

The property name MUST be all upper case! Why is this?

This property will be used to edit an XML file:

@hempnall
hempnall / main.cpp
Created December 8, 2018 14:46
C++ Multiple Inheritance (Virtual) Wierdness
// ConsoleApplication2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#define DEBUG( x ) std::cout << "[+] " << x << std::endl;
class Grandma {
@hempnall
hempnall / REDHAT DVD KICKSTART CREATION.md
Last active August 12, 2018 15:24
REDHAT KICKSTART DVD CREATION

Auto Install Tools

WORK IN PROGRESS

These makefile tool are designed to create unattended install media for Redhat and Debian family of Linux OSs

Redhat

@hempnall
hempnall / Wildcards in Makefiles
Created February 19, 2018 19:53
Wildcards in Makefiles
txt_files := $(wildcard *.txt)
int_files := $(txt_files:.txt=.int)
hexdump_files := $(int_files:.int=.hexdump)
all:
echo $(txt_files)
echo $(int_files)
echo $(hexdump_files)
$(hexdump_files): $(INT_FILES)
@hempnall
hempnall / Flattening Iterators
Last active February 19, 2018 19:17
Flattening Iterators
Flattening Iterators
====================
Summary
-------
This is an interator template that fits a pattern whereby you need to
return a list of objects streamed out of a sorted list of files.
For instance, the Bitcoin blockchain comes in block files (blk00000.dat).
@hempnall
hempnall / main.cpp
Created February 6, 2018 19:49
Pick up to M from N numbers from a list
#include <iostream>
#include <vector>
using namespace std;
typedef std::vector<uint8_t> choices_t;
void printVec( choices_t& picked ) {
for (uint8_t num : picked) cout << (int) num << " ";
cout << "\n";