Skip to content

Instantly share code, notes, and snippets.

View JJL772's full-sized avatar
:shipit:

Jeremy L. JJL772

:shipit:
View GitHub Profile
@JJL772
JJL772 / .clang-format
Last active January 11, 2021 23:09
my very own clang format config
---
BasedOnStyle: Microsoft
FixNamespaceComments: true
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 8
NamespaceIndentation: All
PointerAlignment: Left
SortIncludes: false
Standard: Latest
@JJL772
JJL772 / format.sh
Last active August 9, 2020 01:12
clang formatting script
#!/bin/bash
TOP=$(cd `dirname $0`;cd ..;pwd)
SRCDIR="$TOP/src/"
files=`find "$TOP" -iname "*.c" -o -iname "*.cpp" -o -iname "*.cc" -o -iname "*.h"`
for file in $files; do
clang-format -i $file
done
@JJL772
JJL772 / .editorconfig
Created August 9, 2020 01:12
my own editor config
[*]
end_of_line = lf
insert_final_newline = true
indent_size = 8
indent_style = tab
from pydm.widgets.qtplugins import *
@JJL772
JJL772 / loc
Created September 8, 2020 04:38
list lines of code in directory and stuff. only for C++
function sloc()
{
(find $1 -type f \( -iname "*.cpp" -o -iname "*.h" -o -iname "*.hpp" -o -iname "*.cc" -o -iname "*.hxx" -o -iname "*.c" \) -print0 | xargs -0 cat) | wc -l
}
@JJL772
JJL772 / .clang-format
Last active October 1, 2020 03:12
Clang format for the source engine
---
BasedOnStyle: Microsoft
FixNamespaceComments: 'true'
IndentCaseLabels: 'true'
IndentPPDirectives: BeforeHash
IndentWidth: '4'
NamespaceIndentation: All
PointerAlignment: Left
SortIncludes: 'false'
Standard: Cpp11
@JJL772
JJL772 / msvc-extensions.txt
Last active October 7, 2020 12:04
List of good ol MSVC-specific extensions... And some other stuff with VC/VC++
r-value to l-value binding.
template specialization in the class scope. (Normally this must be done at namespace scope, so not in a class!)
template specialization without the template<> keyword
function template partial specialization
explicit template specializations can have storage classes (e.g. explicit specialization on static function)
@JJL772
JJL772 / vpc.vim
Created December 20, 2020 10:16
Syntax highlighting for VPC scripts in vim
" Vim Syntax file for VPC (Valve Project Creator) files
" Author: JJL77
" Common keys
syn match vpcCommand "\$ImpLib"
syn match vpcCommand "\$ImportLibrary"
syn match vpcCommand "\$AdditionalDependencies"
syn match vpcCommand "\$POSIX_RPaths"
syn match vpcCommand "\$SymbolVisibility"
syn match vpcCommand "\$AdditionalOutputFiles"
@JJL772
JJL772 / .clang-format
Created January 7, 2021 22:46
UNEDITED Microsoft style for Clang-format
---
Language: Cpp
# BasedOnStyle: Microsoft
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
@JJL772
JJL772 / platformtest.h
Last active June 15, 2022 06:19
Somewhat comprehensive list of feature test macros for C/C++. Leave a comment if I forgot anything
// Compile time info
#pragma once
//==========================================================//
// Feature test macros. Enjoy (or not)
//==========================================================//
// FORBID_XXX stuff is used to force disable various intrinsics
// See the OS_XXX section (near the bottom) to find which OS you're using
#if ( defined(__AVX__) ) && !( defined(FORBID_SIMD) || defined(FORBID_AVX) )