Skip to content

Instantly share code, notes, and snippets.

@JadeMatrix
JadeMatrix / timestamp.cpp
Created December 23, 2019 11:51
timestamp + pqxx
// timestamp.hpp ///////////////////////////////////////////////////////////////
#include <pqxx/pqxx>
#include <date/date.h>
#include <string>
namespace asdf
{
using timestamp = date::sys_time< std::chrono::microseconds >;
@JadeMatrix
JadeMatrix / template_alias_test.cpp
Last active September 26, 2018 01:10
Template alias test: GCC 8 vs. Clang 6
#include <iostream>
#include <type_traits>
namespace
{
struct basic_traits {};
template<
typename Traits,
@JadeMatrix
JadeMatrix / TruBlue_v1-3.sublime-color-scheme
Created June 21, 2018 01:15
TruBlu v1.3 Dark WIP — dumped here until I get a repo up
{
"name" : "TruBlu v1.3 Dark",
"author" : "Joseph Durel [jadematrix.art@gmail.com]",
"variables" : {
"foreground" : "#a8cae4", // light blue-grey
"background" : "#163850", // dark blue-grey
"special" : "#3293d8", // bright blue
"out_of_band" : "#b98d00", // gold
"literal" : "#ffffff", // white
"line_highlight" : "#1d547c", // pale blue-grey
/*
Tuple support for `separated_list()`, `tablewriter`, `tablereader`
https://github.com/jtv/libpqxx/issues/97
clang++ -std=c++11 -Linstall/lib -Iinstall/include -lpqxx -lpq tablewriter_example.cpp -o tablewriter_example
*/
// #define PQXX_HAVE_OPTIONAL
#include <pqxx/pqxx>
DROP DATABASE IF EXISTS tablewriter_tuple_test;
CREATE DATABASE tablewriter_tuple_test
TEMPLATE template0
OWNER postgres
ENCODING 'UTF8'
LC_COLLATE 'C'
;
\c tablewriter_tuple_test
@JadeMatrix
JadeMatrix / tuple_iterate.cpp
Last active June 10, 2018 06:29
libpqxx tablewriter tuple support proof-of-concept
#include <iostream>
#include <string>
#include <type_traits> // std::enable_if
#include <utility> // std::size_t
#include <tuple> // std::tuple_size, std::get
#include <vector>
using std::to_string;
std::string to_string( const char* c ) { return std::string{ c }; }
@JadeMatrix
JadeMatrix / .neofetch_config
Created May 24, 2018 16:50
Neofetch config file used to test song detection
# Neofetch config file
# https://github.com/dylanaraps/neofetch
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
# info title
# info underline