This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt install flex bison | |
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1 | |
cd WSL2-Linux-Kernel/tools/perf | |
make -j8 | |
sudo cp perf /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell.exe "$(wslpath -w .)\myscript.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// how to locate application data %AppData% directory path on Windows 10 MSVC | |
// see on documentation https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath?redirectedfrom=MSDN | |
// compiled with cl .\appdata.c Shell32.lib | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <shlobj_core.h> | |
#include <direct.h> | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1='$(if [[ ! "$?" = "0" ]]; then echo "\[\e[1;31m\]($?)\[\e[0m\] "; fi)\h:\[\e[1;31m\]$(basename $PWD)\[\e[0m\]\[\e[1;33m\]$(__git_ps1 " [%s]")\[\e[0m\]> ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "dict.h" | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
static int NUMBUCKETS = 8; | |
static int INITBUCKETCAPACITY = 8; | |
void dict_new(struct Dict* dict) { | |
dict->numbuckets = NUMBUCKETS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/llvm/llvm-project.git --depth=1 /tmp/llvm | |
mkdir /tmp/llvm/build | |
cd /tmp/llvm/build | |
cmake -DLLVM_ENABLE_PROJECTS="clang;openmp;libcxx;libcxxabi;libunwind;lldb;compiler-rt;lld" -DCMAKE_INSTALL_PREFIX="/opt/llvm" ../llvm | |
make -j64 | |
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if a library exists | |
define lib_exists | |
echo "int main(){}" | g++ -x c++ -Wl,--no-as-needed -l$(1) - | |
endef | |
# Update a git submodule | |
define update_external | |
if git submodule status external/$(1) | egrep -q '^[-]|^[+]'; then\ | |
git submodule update --init external/$(1);\ | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vswhere = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' | |
$vsfound = Test-Path $vswhere | |
if (-Not $vsfound) { | |
Write-Host "vswhere not found in $vswhere" | |
Exit 1 | |
} | |
$vspath = & $vswhere -property installationPath | |
Write-Host "vspath = $vspath" | |
Push-Location "$vspath\Common7\Tools" | |
cmd /c "VsDevCmd.bat&set" | Foreach { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Survey | |
advixe-cl --collect=survey --stacks -- ./foo | |
# Dependencies | |
advixe-cl --collect=dependencies --stacks -- ./foo | |
# Memory access patterns | |
advixe-cl --collect=map --stacks -- ./foo | |
# Create snapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC ?= gcc | |
CFLAGS += -std=c99 -Wall -Wextra -Iinclude | |
LDLIBS = -lm | |
.PHONY: all release debug native %test clean% | |
all: release | |
release: target/release/foobar | |
debug: target/debug/foobar |
NewerOlder