Skip to content

Instantly share code, notes, and snippets.

View harrism's full-sized avatar

Mark Harris harrism

View GitHub Profile
@harrism
harrism / github-conventional-comments.js
Last active August 31, 2023 00:53 — forked from ifyoumakeit/github-conventional-comments.js
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "👏 praise",
nitpick: "🤓 nitpick",
suggestion: "💡 suggestion",
issue: "🚩 issue",
todo: "☑️ todo",
question: "❓ question",
thought: "💭 thought",
@harrism
harrism / gh-replace-label.sh
Created November 16, 2022 11:49
Use the GitHub CLI to replace a label on all issues and PRs in a repo with another label
#!bin/bash
issues=`gh issue list -s all -l $1 --json number --jq '.[].number'`
echo Relabeling `echo $issues | wc -w` issues
for issue in $issues; do
gh issue edit --remove-label $1 $issue
gh issue edit --add-label $2 $issue
done
@harrism
harrism / Recurrence.cu
Last active December 1, 2021 11:46
Using Thrust for the Taylor series approximation of 1 / (1-x). Demonstrates evaluating recurrences in parallel with a scan using Thrust running on CUDA.
#include <thrust/scan.h>
#include <thrust/device_vector.h>
#include <thrust/fill.h>
#include <vector>
#include <algorithm>
#include <cstdlib>
int main(int argc, char **argv)
{
using T = double;
@harrism
harrism / useful_cpp_experiments.md
Last active August 5, 2020 00:33
Useful C++ experiments: a place to stash little C++ experiment results

Useful C++ experiments

A place to stash experiments I do with godbolt / quickbench / etc.

Which is faster for small data, std::map or std::unordered map?

https://quick-bench.com/q/70Eg-tVt3M4lR4tlMqv3_ZiOcYs

std::map seems faster below 128 items (when the map is int:int).