Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
> CMakeLists.txt
echo "cmake_minimum_required (VERSION 3.6)" >> CMakeLists.txt
echo "project(global)" >> CMakeLists.txt
for dir in `ls -d */`
do
echo "Entering dir $dir"
pushd $dir
dir=$(echo $dir | tr -d '/')
#include <type_traits>
template <typename T>
constexpr bool checkTrivial() {
if constexpr (std::is_pointer_v<T>) {
static_assert(std::is_trivially_copyable_v<std::remove_pointer_t<T>>);
}
else if constexpr (std::is_reference_v<T>) {
static_assert(std::is_trivially_copyable_v<std::remove_reference_t<T>>);
}
@cyrsap
cyrsap / .clang-format
Created August 3, 2018 10:51
Clang-format file
---
Language: Cpp
# BasedOnStyle: LLVM
IndentWidth: 4
AccessModifierOffset: -4
ColumnLimit: 120
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
@cyrsap
cyrsap / convert.sh
Created December 4, 2017 14:41 — forked from akost/convert.sh
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.m" -o -name "*.cpp" -o -name "*.c" -o -name "*.h" -o -name "*.hpp" -type f |
while read file
do
echo " $file"
fileinfo=`file -b $file`