Skip to content

Instantly share code, notes, and snippets.

@aianau
aianau / gist:9870361f4ffe870182e7a917528e8093
Created June 10, 2022 13:44
kali linux .zshrc config
# ~/.zshrc file for zsh interactive shells.
# see /usr/share/doc/zsh/examples/zshrc for examples
setopt autocd # change directory just by typing its name
#setopt correct # auto correct mistakes
setopt interactivecomments # allow comments in interactive mode
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’
setopt nonomatch # hide error message if there is no match for the pattern
setopt notify # report the status of background jobs immediately
setopt numericglobsort # sort filenames numerically when it makes sense
@aianau
aianau / type.cpp
Last active August 2, 2021 12:06
get type of variable
#include <iostream>
#include <string_view>
template <class T>
constexpr std::string_view type_name()
{
using namespace std;
#ifdef __clang__
string_view p = __PRETTY_FUNCTION__;
@aianau
aianau / PrintLastError();
Last active June 7, 2019 09:02
Prints last error by GetLastError(), Format allocating a buffer.
#include <stdlib.h>
#include "windows.h"
void PrintLastError()
{
//Get the error message, if any.
DWORD errorMessageID = ::GetLastError();
if (errorMessageID == 0)
{
return; //No error message has been recorded
@aianau
aianau / PrintLastError();
Last active June 7, 2019 09:02
Prints last error by GetLastError(), FormatMessageA().
#include <stdlib.h>
#include "windows.h"
void PrintLastError()
{
//Get the error message, if any.
DWORD errorMessageID = ::GetLastError();
if (errorMessageID == 0)
{
return; //No error message has been recorded