Skip to content

Instantly share code, notes, and snippets.

View erinacio's full-sized avatar

Kai Liu erinacio

  • Martian Colony
  • Mars
View GitHub Profile
llvm-project-17 /opt/
llvm-project-17 /opt/llvm17/
llvm-project-17 /opt/llvm17/bin/
llvm-project-17 /opt/llvm17/bin/amdgpu-arch
llvm-project-17 /opt/llvm17/bin/analyze-build
llvm-project-17 /opt/llvm17/bin/bugpoint
llvm-project-17 /opt/llvm17/bin/c-index-test
llvm-project-17 /opt/llvm17/bin/clang
llvm-project-17 /opt/llvm17/bin/clang++
llvm-project-17 /opt/llvm17/bin/clang-17
@erinacio
erinacio / iterators.cpp
Created November 21, 2022 12:58
Demonstrate how to make your own iterator type.
#include <iterator>
[[noreturn]] void TODO() { abort(); }
struct output_iterator {
using difference_type = ptrdiff_t;
int &operator*() { TODO(); }
output_iterator &operator++() { TODO(); }
output_iterator operator++(int) { TODO(); } // NOLINT(cert-dcl21-cpp)
};
#!/usr/bin/env python3
import sys
import os
import requests
import argparse
import base64
from urllib.parse import quote
stdout = sys.stdout
// -std=c++14
#include <iostream>
#include <string>
#include <utility>
#include <unordered_map>
#include <boost/optional.hpp>
#include <boost/optional/optional_io.hpp>
// disclaimer: not tested
template <typename L, typename R>
@erinacio
erinacio / crc32.c
Last active August 9, 2017 00:01
CRC32 calculation code written (or copied?) by me long ago, doing a backup here.
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
const static uint32_t crc32_table[256] =
{
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,