Skip to content

Instantly share code, notes, and snippets.

View tiendq's full-sized avatar
🌳
Code for a Living

Tien Do tiendq

🌳
Code for a Living
View GitHub Profile
@tiendq
tiendq / badge.json
Created October 19, 2022 02:20
Sample badge metadata for CryptoBadge Reboot
{
"textColor": "#000000",
"backgroundColor": "#ffffff"
}

Building Sourcetrail

# Boost is installed in /usr/local with `b2 install`
# llvm-project is built

cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DQt5_DIR=/Users/tiendo/Qt_5_12_3/5.12.3/clang_64/lib/cmake/Qt5 \
-DClang_DIR=/Users/tiendo/GitHub/clang-llvm/build/lib/cmake/clang -DBUILD_CXX_LANGUAGE_PACKAGE=ON ..
cmake --build .

C++ Toolbox

Libraries

fmt A modern formatting library.

googletest Google Testing and Mocking Framework.

let seedDate = Date.now();
let sampleDateStrings = [];
let sampleDateValues = [];
const TOTAL_SAMPLE = 1000000;
for (let i = 0; i < TOTAL_SAMPLE; ++i) {
sampleDateStrings.push((new Date(seedDate + i)).toISOString());
sampleDateValues.push(seedDate + i);
}
// Testing EventEmitter and Promise, async/await
const EventEmitter = require('events');
const http = require('http');
const fs = require('fs').promises;
const myEmitter = new EventEmitter();
async function handler3() {
console.log('handler3: myevent was fired! test Promise');
@tiendq
tiendq / install-cmake.md
Created April 10, 2019 05:08
Install the latest CMake on Ubuntu
@tiendq
tiendq / delete_git_submodule.md
Created January 3, 2019 04:28 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
This seems to be a more modern version (copied from https://stackoverflow.com/a/36593218/2066118):
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule
# https://github.com/mjkonarski/oh-my-git-aliases
alias g='git'
alias gst='g status'
# alias gfe='g fetch'
alias gco='g checkout'
# alias gcd='gco develop'