Skip to content

Instantly share code, notes, and snippets.

View christianparpart's full-sized avatar
🎃
Loading

Christian Parpart christianparpart

🎃
Loading
View GitHub Profile
---
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,bugprone-*,performance-*,readability-non-const-parameter,readability-redundant-*,cppcoreguidelines-slicing'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
abstract contract A {
modifier m() virtual;
function f() A.m public {}
}
contract B is A {
modifier m() virtual override { _; }
}
@christianparpart
christianparpart / nth.h
Last active December 2, 2020 22:24
C++ helper to extract nth element from a range in a loop.
#pragma once
#include <utility>
#include <iterator>
template <int N, typename Range>
class nth_range {
public:
using RangeIterator = decltype(std::begin(std::declval<Range>()));
constexpr explicit nth_range(Range& _range) noexcept : begin_{std::begin(_range)}, end_{std::end(_range)} {}
#include <type_traits>
#include <typeinfo>
#include <cstdio>
template <
template <class> class T,
class A,
class B
>
bool f(T<A>&& a, T<B>&& b)
@christianparpart
christianparpart / recovered.diff
Created July 21, 2020 14:39
Please apply that to a newly created branch created out of `master` branch.
commit 9ea1b7bbf591ce605d1171b808aa3f68aabe4b40
Author: Rachid <memcpy@local.host>
Date: Tue Jul 21 15:05:12 2020 +0200
[libterminal, terminalview] replace std::bind with lambda
- add cmake package dependency for ubuntu
diff --git a/README.md b/README.md
index 09d703a..4fbdc0d 100644
git checkout master
git pull
git checkout -b my-NEW-branch
git cherry-pick f9b98e1bc186c59b7f23526b8568bc733cebe47a
git push -u origin my-NEW-branch
# make sure you are in YOUR branch
git checkout replace-binds
# retrieve the commit SHA of your commit
SHA=$(git log --oneline HEAD~.. | awk '{print $1}')
git fetch
git reset --hard origin/wip
# XXX are you still in replace-binds branch?
@christianparpart
christianparpart / vte-underline-test.sh
Created July 17, 2020 14:46
Tiny script for showing / testing underline / grid cell decorations in terminal emulators.
#! /bin/bash
function ul_color1() {
echo -ne "\033[58:2:255:250:32m"
}
function ul_color2() {
echo -ne "\033[58:2:255:32:32m"
}
@christianparpart
christianparpart / vte-apps-cheat-sheet.md
Last active July 18, 2020 20:13
Terminal based Application cheat sheet

Terminal based Application cheat sheet

Naming convention

  • ESC 0x1b - Introduces an escape sequence
  • CSI 0x1B [- Control sequence introducer
  • OSC 0x1B ] - Operating system command

Functions