Skip to content

Instantly share code, notes, and snippets.

View mlcollard's full-sized avatar

Michael L. Collard mlcollard

View GitHub Profile
cmake /Source
make
make run
git grep -h "@TODO" | sed -e 's/^[ ]*//' | sort | uniq --count | sort --reverse --sort=numeric
class MethodCount {
public:
int count();
private:
CPPParser parser;
};
int main() {
MethodCount counter;
class Adaptee {
public:
void specificRequest();
};
class Target {
public:
virtual void request() = 0;
};
git grep -h "@TODO"| sed 's/^[ ]*//g' | sort | uniq -c | sort -r -n
@mlcollard
mlcollard / SpaceIndented.cpp
Last active February 4, 2022 19:57
Example of problems with spaces following tab indentation. SpaceIndented.cpp is completely indented using spaces, TabIndented.cpp is indented using tabs followed by spaces for fine alignment. Try changing tab settings to see difference
// constructor
srcMLOut(TokenStream* ints,
xmlOutputBuffer * output_buffer,
const char* language);
# Install on macOS
brew install mkcert
# Generate and install a local CA (Certification Authority)
# - Do this once
# - Can do so in any directory
mkcert -install
# Create a new certificate in your GitHub Pages repo top directory
# - Change to your directory
@mlcollard
mlcollard / CMakeLists.txt
Created October 11, 2021 12:15
CMake file for srcComplexity
# @file CMakeLists.txt
#
# CMake files for the srccomplexity program
cmake_minimum_required(VERSION 3.20)
# project info
project(srcComplexity)
find_package(LibXml2 REQUIRED)
@mlcollard
mlcollard / LoadBundlePlistArrayofDictionaries.swift
Last active June 2, 2021 18:27
iOS: Load a bundle plist into an array of dictionaries
/* Read the classData array of dictionaries from a bundle plist */
// url of resource file
// Note: Assumes you have added a classes.plist array of dictionaries to the project
guard let classURL = Bundle.main.url(forResource: "classes", withExtension:"plist") else {
print("Error: Unable to form path")
return
}
// data in resource file
DELETE /todo/items/124 HTTP/2
Host: mlcollard.net