Skip to content

Instantly share code, notes, and snippets.

View thawk's full-sized avatar

thawk

View GitHub Profile
@thawk
thawk / .gdbinit
Created May 16, 2021 06:55 — forked from skyscribe/.gdbinit
GDB init file to print STL containers and data members
#
# STL GDB evaluators/views/utilities - 1.03
#
# The new GDB commands:
# are entirely non instrumental
# do not depend on any "inline"(s) - e.g. size(), [], etc
# are extremely tolerant to debugger settings
#
# This file should be "included" in .gdbinit as following:
# source stl-views.gdb or just paste it into your .gdbinit file
@thawk
thawk / cmdoptions.cpp
Created October 20, 2020 03:13 — forked from randomphrase/cmdoptions.cpp
Demonstration of how to do subcommand option processing with boost program_options
#define BOOST_TEST_MODULE subcommand options
#include <boost/test/unit_test.hpp>
#include <boost/program_options.hpp>
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>
struct GenericOptions {
bool debug_;
};
@thawk
thawk / coro_life.py
Created October 17, 2020 04:30 — forked from ramalho/coro_life.py
John Conway's Game of Life implemented with coroutines, by Brett Slatkin
#!/usr/bin/env python3
# Copyright 2014 Brett Slatkin, Pearson Education Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@thawk
thawk / dump-1538540733306.cljs
Created October 3, 2018 04:25
ClojureScript REPL dump
cljs.user=> 1
1
@thawk
thawk / .gitignore
Last active July 4, 2020 20:35
SpaceVim custom init.vim
.netrwhist
@thawk
thawk / dict_merge.py
Created August 26, 2017 09:13 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
@thawk
thawk / cVimrc
Last active March 25, 2019 10:56
Configuration file for cVim (Chrome Extension)
set nosmoothscroll
set noautofocus
set typelinkhints
set autoupdategist
set cncpcompletion
let previousmatchpattern = "((?!last)(上一页|上一頁|上页|上頁|后退|prev(ious)?|back|less|<|‹|«| )+)"
let nextmatchpattern = "((?!first)(下一页|下一頁|下页|下頁|前进|前進|繼續|继续|更多|next|more|>|›|»|forward| )+)"
let barposition = "bottom"
@thawk
thawk / .gitignore
Last active April 25, 2017 12:16
Boost timer test
bin/
GPATH
GRTAGS
GTAGS
@thawk
thawk / random_test.cpp
Created March 19, 2017 08:47
Test boost::random
#include <boost/filesystem/path.hpp>
#include <iostream>
#include <boost/random.hpp>
#include <boost/cstdint.hpp>
#include <boost/integer_traits.hpp>
using boost::filesystem::path;
using namespace std;
int main()