Skip to content

Instantly share code, notes, and snippets.

@kirkshoop
kirkshoop / spec.json
Created January 29, 2021 20:24
Executive Orders by presidential term
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": { "url": "https://www.federalregister.gov/api/v1/documents.json?conditions%5Bcorrection%5D=0&conditions%5Bpresidential_document_type%5D=executive_order&conditions%5Btype%5D%5B%5D=PRESDOCU&fields%5B%5D=citation&fields%5B%5D=document_number&fields%5B%5D=president&fields%5B%5D=type&fields%5B%5D=subtype&fields%5B%5D=publication_date&fields%5B%5D=signing_date&fields%5B%5D=title&fields%5B%5D=effective_on&fields%5B%5D=executive_order_number&per_page=1200", "format": { "type": "json", "property": "results"}},
"transform": [
{ "filter": "year(datum.publication_date) > 1996"},
{
"joinaggregate": [{
"op": "min",
"field": "publication_date",
"as": "firstYear"
@kirkshoop
kirkshoop / build-llvm.bash
Last active February 6, 2020 23:46 — forked from zchee/build-llvm.bash
Build llvm for OS X
#!/bin/bash
set -e
# Building LLVM on OSX CMake setup script
#
# Required:
# - clang by Xcode6 or later
# - cmake
# - ninja
#
// Copyright Eric Niebler 2015
// Copyright Casey Carter 2015
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/caseycarter/cmcstl2
#include <type_traits>
@kirkshoop
kirkshoop / concepts.h
Last active August 2, 2018 00:59
minimal concepts for P0443 and P1054
#include <cstddef>
#include <type_traits>
#include <exception>
#include <utility>
#include <memory>
#include <array>
namespace mc {
@kirkshoop
kirkshoop / Keybase.md
Last active July 4, 2018 16:14
Keybase

Keybase proof

I hereby claim:

  • I am kirkshoop on github.
  • I am kirkshoop (https://keybase.io/kirkshoop) on keybase.
  • I have a public key ASCS6ReLdgP09JTkQeSOSFQDnqSGaero-TX-CcyixaJbqwo

To claim this, I am signing this object:

@kirkshoop
kirkshoop / await.cpp
Created February 13, 2015 02:24
await schedule() and for await(t : schedule_periodically()){} using N4286
// await.cpp : Defines the entry point for the console application.
// Requires VS 2015
//
// In VS 2015 x64 Native prompt:
// CL.exe /Zi /nologo /W3 /sdl- /Od /D _DEBUG /D WIN32 /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP /await await.cpp
//
#include <iostream>
#include <future>
#include <thread>
@kirkshoop
kirkshoop / rxcpp_pi.cpp
Last active August 29, 2015 14:04 — forked from film42/rxcpp_pi.cpp
pi series - Rxcpp and for loop
auto pi = [](int k) {
return ( k % 2 == 0 ? -4 : 4 ) / ( long double )( ( 2 * k ) - 1 );
};
auto total = rxcpp::observable<>::range(1, 10000000)
.map(pi)
.sum()
.as_blocking().last();
std::cout << "Pi: " << total << std::endl;
@kirkshoop
kirkshoop / create state sequences
Created September 6, 2013 15:09
Create state sequences to control behavior of the scenario
// when enable or disable is executing mark as working (both commands should be disabled)
observable(from(enable->IsExecuting())
.combine_latest([](bool ew, bool dw)
{
return ew || dw;
}, disable->IsExecuting()))
->Subscribe(observer(working));
// when enable is executed mark the scenario enabled, when disable is executed mark the scenario disabled
@kirkshoop
kirkshoop / creating ReactiveCommand
Created September 6, 2013 15:07
Creating ReactiveCommand for scenario enable and disable
// start out disabled
auto enabled = std::make_shared<rx::BehaviorSubject<bool>>(false);
// start out not-working
auto working = std::make_shared<rx::BehaviorSubject<bool>>(false);
// use !enabled and !working to control canExecute
enable = std::make_shared < rxrt::ReactiveCommand < RoutedEventPattern> >(observable(from(enabled)
.combine_latest([](bool e, bool w)
{
return !e && !w;
@kirkshoop
kirkshoop / bind ReactiveCommand to Xaml button
Created September 6, 2013 15:05
Binding scenario buttons to the ReactiveCommand
rxrt::BindCommand(ScenarioEnableButton, enable);
rxrt::BindCommand(ScenarioDisableButton, disable);