Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AndrewOfC's full-sized avatar

Andrew Page AndrewOfC

View GitHub Profile
@AndrewOfC
AndrewOfC / orvalues.cpp
Created April 9, 2024 22:53
ORing Values in C++ With Vararg Template
/*
One thing I like in like in languages like python and perl
is you can logically OR a series of values and it the
expression will result in the first one that is 'non null'
or 'true'. This facility is missing in C++ as the logical
or operator(||) produces a boolean.
One thing to be cautious of, is that in python and perl
evalution of the OR'd expressions stops on the first one
that is true, any further expressions are not evalutated,
@AndrewOfC
AndrewOfC / build.yaml
Created December 7, 2023 14:12
GitHub Action Stanza for Building C/C++ for Redhat RPMs
name: Build
on: push
jobs:
RedHat:
runs-on: ubuntu-latest
container: docker.io/andrewofc/redhatbuilder
steps:
- name: Check out repository
uses: actions/checkout@v4
@AndrewOfC
AndrewOfC / gitlab_ci_lint.py
Created February 13, 2019 15:50
Q&D python for command line to validate .gitlab-ci.yml
#! /usr/bin/python
#
# script to validate .gitlab-ci.yml
#
import sys
import requests
import json
def main():
r = requests.post("https://gitlab.example.com/api/v4/ci/lint", json={ 'content': file(sys.argv[1], 'r').read() })