Skip to content

Instantly share code, notes, and snippets.

View nikhedonia's full-sized avatar
💭
actively open-sourcing

Gaetano Checinski nikhedonia

💭
actively open-sourcing
View GitHub Profile
include_defs('//BUCKAROO_DEPS')
def test_tree(name, path):
genrule(
name = name,
out = ".",
srcs = [path],
cmd = "cp -r $SRCS/* $OUT"
)
return ":"+name
@nikhedonia
nikhedonia / boost-test.bzl
Created October 22, 2018 10:01
boost test using sh_test
include_defs('//BUCKAROO_DEPS')
def test_tree(name, path):
genrule(
name = name,
out = ".",
srcs = [path],
cmd = "cp -r $SRCS/* $OUT"
)
return ":"+name
def merge_dicts(x, y):
z = x.copy()
z.update(y)
return z
cxx_library(
name = "bitcoin_crypto_sse41",
header_namespace= '',
compiler_flags = ["-fstack-protector-all","-fPIE","-msse4.1"],
Project Files Disk Space stat md5sum shasum sha256sum
LLVM 319618 9.5 GB 1.7s 7.5s 9.7s 20s
OpenCV 26923 2.5 GB 0.3s 2.0s 2.4s 5.5s
OpenSSL 35699 855 MB 0.3s 0.4s 0.8s 1.2s
#include <experimental/coroutine>
#include <type_traits>
#include <iostream>
#include <memory>
using namespace std::experimental;
template<class T>
struct AwaitValue {
T x;
auto squares = []() -> seq<int> {
int x = 0;
while (true) {
co_yield x * x;
++x;
}
};
int i = 0;
for (auto x : squares()) {
std::cout << x << std::endl;
// squares is infinite, so we need to break
if (i > 10) {
break;
}
++i;
}
std::vector<int> v = range()
>> take(5)
>> toVector();
// v = { 0, 1, 2, 3, 4 }
// Sum of the first 10 squares
auto total = squares() >> take(10) >> sum();
// Jumps between the first 10 squares
auto jumps = squares()
>> scan(0, [](auto x, auto y) { return y - x; })
>> take(10);
// The obligatory fibonacci
auto fibonacci = []() -> seq<int> {
auto fibonacci = []() -> seq<unsigned long long> {
auto a = 0ll;
auto b = 1ll;
while (true) {
co_yield a;
tie(a, b) = tuple{a + b, a};
}
};