A HOWTO for getting undercurl support in Neovim running in Tmux and Konsole.
You need to be running Konsole v22.11.80 or newer (undercurl support was introduced in this commit on 2022-08-26).
A HOWTO for getting undercurl support in Neovim running in Tmux and Konsole.
You need to be running Konsole v22.11.80 or newer (undercurl support was introduced in this commit on 2022-08-26).
#!/bin/bash | |
# | |
# Steps to build GCC 10 on Debian Buster. | |
# | |
set -e -x | |
# Install all dependencies. | |
export DEBIAN_FRONTEND=noninteractive | |
apt update |
#!/bin/bash | |
# | |
# Steps to build Python 3.9 on Debian Buster, including all modules. | |
# | |
set -e -x | |
# Install all dependencies. | |
export DEBIAN_FRONTEND=noninteractive | |
apt update |
#!/usr/bin/env python3 | |
# | |
# Limits the maximal virtual memory for a subprocess in Python. | |
# | |
# Linux only. | |
# | |
import subprocess | |
import resource |
// | |
// Limits the maximal virtual memory of the process to half of the total | |
// amount of RAM on the system. | |
// | |
// Linux only. | |
// | |
// Compilation: | |
// | |
// gcc -std=c11 -pedantic limit-virtual-memory.c -o limit-virtual-memory | |
// |
// $ g++ -std=c++17 -pedantic -Wall -Wextra visit-variant.cpp -o visit-variant | |
// $ ./visit-variant | |
// Implementation: | |
// | |
// Based on http://en.cppreference.com/w/cpp/utility/variant/visit | |
#include <variant> | |
template<typename... Ts> struct make_overload: Ts... { using Ts::operator()...; }; |
// We need to use Vec::into_iter() instead of Vec::iter() to create a consuming | |
// iterator that moves each value out of the vector. | |
fn main() { | |
let v = vec![1, 2, 3]; | |
let v: Vec<Option<i32>> = v.into_iter().map(Some).collect(); | |
assert_eq!(v, [Some(1), Some(2), Some(3)]); | |
} |
// Item::new() accepts both &str and String. When called, it creates a copy of | |
// the parameter and uses it to initialize the returned item. | |
// | |
// The trick is in the use of the Into trait: | |
// https://doc.rust-lang.org/std/convert/trait.Into.html | |
struct Item { | |
id: String | |
} |
// $ g++ -std=c++11 -pedantic -Wall -Wextra cpp11-string-literal.cpp -o cpp11-string-literal | |
// $ ./cpp11-string-literal | |
#include <string> | |
// Emulates the standard std::string literal ("..."s) from C++14. Since 's' is | |
// reserved by the standard, we have to use '_s' instead of 's'. | |
std::string operator "" _s(const char *str, size_t length) { | |
return std::string(str, length); | |
} |
// $ g++ -std=c++14 -pedantic -Wall -Wextra double-dispatch.cpp -o double-dispatch | |
// $ ./double-dispatch | |
// | |
// Also works under C++11. | |
#include <iostream> | |
#include <memory> | |
#if __cplusplus == 201103L | |
namespace std { |