Skip to content

Instantly share code, notes, and snippets.

@patstew
patstew / duck.cpp
Created November 10, 2022 23:16
Duck typing for C++
#include <cassert>
#include <cstddef>
#include <type_traits>
#include <utility>
// Duck typing for C++
namespace duck {
template <template <class> class I> class ref;
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
set -g default-terminal "screen-256color"
@patstew
patstew / startup.py
Created March 8, 2017 13:03
notepad++ startup.py
from Npp import *
def indent_auto_detect(arg):
for i in range(editor.getLineCount()):
pos = editor.positionFromLine(i)
indent = editor.getLineIndentPosition(i)-pos
if indent > 0:
if ord('\t') == editor.getCharAt(pos):
console.write("Indentation: Tabs\n")
editor.setUseTabs(True)
#!/bin/bash
for lib in libc.so.6 libm.so.6 libpthread.so.0 libdl.so.2 libresolv.so.2 librt.so.1; do
objdump -T /usr/lib/$lib
done | awk -v maxver=2.5 -f <(cat - <<'EOF'
BEGIN {
split(maxver, ver, /\./)
limit_ver = ver[1] * 10000 + ver[2]*100 + ver[3]
}
/GLIBC_/ {
gsub(/\(|\)/, "",$(NF-1))
#ifndef SCOPEGUARD_H
#define SCOPEGUARD_H
#define ANON_VAR__(a,b) a##b
#define ANON_VAR_(a,b) ANON_VAR__(a,b)
#define ANON_VAR ANON_VAR_(_anonvar, __LINE__)
// ____________________________________[ uncaught_exception_count.hpp ]____________________________________
// Copyright Evgeny Panasyuk 2012.
// Distributed under the Boost Software License, Version 1.0.