Skip to content

Instantly share code, notes, and snippets.

View krestovolt's full-sized avatar
💡
nopers

kautsar.ab krestovolt

💡
nopers
  • Jakarta, Indonesia
View GitHub Profile
@krestovolt
krestovolt / BUILD.bazel
Last active January 14, 2023 00:04
Bazel cross-toolchain for CGO on mac (M1 arm64) targeting x86_64
# toolchain/BUILD.bazel
package(default_visibility = ["//visibility:public"])
cc_toolchain_suite(
name = "cc_linux_cross_64_suite",
toolchains = {
"x86_64": ":linux_cross_toolchain_64",
"x86_64|gcc-cross": ":linux_cross_toolchain_64",
},
@krestovolt
krestovolt / iterative-merge-sort.cpp
Last active June 26, 2021 08:04
Iterative merge sort
/*
An attempt to implement bottom-up (iterative) merge sort
using reusable auxiliary array for the merging step.
ref: https://www.interviewbit.com/tutorial/merge-sort-algorithm/
*/
#include <iostream>
using std::cout;
#include <iostream>
#include <utility>
#include <vector>
#define ll long long
using namespace std;
template <typename T> class Point
{
public:
T x;
@krestovolt
krestovolt / simple_bitset.cpp
Last active July 27, 2019 18:52
Minimal bitset implementation.
#include <stdio.h>
#define BIT_SHIFTCNT (5)
#define BIT_CNT (1 << BIT_SHIFTCNT)
#define BIT_MASK (BIT_CNT - 1)
// This code implementation is for learning purpose
// on how to perform bit masking with any bit length,
// and for snippet.
// Use at your own risk.