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 / 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 / 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 / .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 / 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
}
from pydm.widgets.qtplugins import *
@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
@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 / .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 / steamrt-setup.sh
Created July 28, 2020 03:29
steamrt docker setup script
#!/bin/bash
if [ $EUID -ne 0 ]; then
echo "Please run script as root"
exit 1
fi
function download_runtime()
{
URLROOT=https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-steam-client-general-availability/
@JJL772
JJL772 / math_proxy.cpp
Created July 18, 2020 22:34
Fixes unresolved symbols when compiling the Source SDK 2013 on newer GCC toolchains. Note: you will need to enable -fabi-compat=2 for GCC to link properly
/**
*
* math_proxy.cpp - Implements certain unresolved symbols and points them to their proper endpoints
*
*/
#include <math.h>
#if __GNUC__ > 5
extern "C" float __powf_finite(float x, float y)