Skip to content

Instantly share code, notes, and snippets.

View GitBubble's full-sized avatar

Arthur GitBubble

View GitHub Profile
@GitBubble
GitBubble / Base.cpp
Created April 23, 2021 09:12 — forked from sacko87/Base.cpp
Factory Pattern in C++ with templates (using the confusingly recurring template and registry patterns)
#include "Base.h"
Base::Base() :
IsRegistered_(false)
{ }
Base::Base(bool isRegistered) :
IsRegistered_(isRegistered)
{ }
msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
@GitBubble
GitBubble / ordered_logging.cpp
Created October 10, 2020 11:41
ordered logging utility
#include <iostream>
#include <string>
#include <initializer_list>
class Log: public std::ostringstream
{
public:
Log() = default;
@GitBubble
GitBubble / mount_windows_directory.md
Last active May 8, 2020 01:33
mount windows shared directory in domain in linux

with cifs-utility in ubuntu, it's easy to access windows shared directory

sudo mount -t cifs -o username=xxx,pass=xxx,vers=2.1 //10.61.16.223/HiVaProfiler /media/code/

@GitBubble
GitBubble / template_tricks
Created March 20, 2020 09:45
template_tricks
```
#include <string.h>
#include <memory> // for std::unique_ptr
#include <mutex> // for std::mutex
#include <iterator>
template <class T, class elem_type = class T::value_type>
class ring_iterator; // forward declaration
template <class T, size_t N>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#include <thread>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(void) {
@GitBubble
GitBubble / git-use-https-no-ask-username.md
Created March 15, 2020 05:43
git-use-https-no-ask-username

git config --global credential.helper osxkeychain

git config --global credential.helper store

then do some push/pull works.

@GitBubble
GitBubble / nv-demo.md
Last active March 10, 2020 14:18
nvtxtoolsExt
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "nvToolsExt.h"
#include <thread>


int func(int a)
{
@GitBubble
GitBubble / iterm2-solarized.md
Created March 1, 2020 07:42 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@GitBubble
GitBubble / gtest-usage
Created February 29, 2020 23:53
gtest bugs...
1, using clang 11.0 build gtest will prompt error : tuple not support
2, solve by cmake -DCMAKE_CXX_STANDARD=17