Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am miniriley2012 on github.
  • I am rileyq (https://keybase.io/rileyq) on keybase.
  • I have a public key ASAVmogYgHYnGQGXSZqib1-XteqQ5sJMzsM8w-tkS-_vdgo

To claim this, I am signing this object:

get_directory_property(THIS_PROJECT_PARENT_DIR PARENT_DIRECTORY)
if (NOT THIS_DIRECTORY_PARENT_DIR)
set(THIS_PROJECT ${PROJECT_NAME})
endif ()
add_test(build_tests COMMAND ${CMAKE_COMMAND} -E true)
set_tests_properties(build_tests PROPERTIES DEPENDS build_tests_command)
add_custom_target(build_tests_command COMMAND ${CMAKE_CTEST_COMMAND})
macro(add_build_test target)
add_executable("${target}" ${ARGN})
add_test(NAME "${target}_test" COMMAND "${target}")
add_dependencies(build_tests_command ${target})
endmacro()
@miniriley2012
miniriley2012 / FetchGit.cmake
Last active September 2, 2020 22:14
A CMake thing to fetch git repositories
include(FetchContent)
macro(FetchGitVersion name url tag)
FetchContent_Declare(${name}
GIT_REPOSITORY ${url}
GIT_TAG ${tag}
${ARGN}
)
FetchContent_MakeAvailable(${name})
@miniriley2012
miniriley2012 / CMakeLists.txt
Last active August 13, 2019 19:07
Minesweeper in C++ with ncurses
cmake_minimum_required(VERSION 3.15)
project(minesweeper)
set(CMAKE_CXX_STANDARD 17)
add_executable(minesweeper main.cpp)
target_link_libraries(minesweeper ncurses)
@miniriley2012
miniriley2012 / # llvm - 2018-08-10_01-12-58.txt
Created August 10, 2018 15:22
llvm on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for llvm on macOS 10.13.6
Build date: 2018-08-10 01:12:58
@miniriley2012
miniriley2012 / main.cpp
Created August 8, 2018 03:47
Is it good? no. Does it work? yes.
#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
/// Get input from standard input
/// \tparam T type of input to return
/// \param prompt a optional prompt to show the user
/// \return input a T
template<typename T>
@miniriley2012
miniriley2012 / 8ball.java
Last active April 29, 2017 23:05
Simple 8-ball game in java based on the degrees of certainty
import java.util.Scanner; // Import "Scanner" for user input
import java.util.concurrent.ThreadLocalRandom; // import "ThreadLocalRandom" for random number creation
class eightBall { // Start class
public static void main(String[] args) { // start main
System.out.println("Welcome to my magic eight ball! press ^C to exit."); // Welcome message
Scanner sc = new Scanner(System.in); // Set up Scanner for System.in
while (true) { // Start loop until user does keyboard interrupt
System.out.print("Ask me a question: "); // Prompt for input