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 <iostream> | |
#include <QString> | |
#include <QByteArray> | |
#include <QDebug> | |
#include <QFile> | |
#include <QCryptographicHash> | |
#include <botan/pkcs8.h> | |
#include <botan/hex.h> |
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 <iostream> | |
#include <QString> | |
#include <QByteArray> | |
#include <QDebug> | |
#include <QFile> | |
#include <QCryptographicHash> | |
#include <botan/pkcs8.h> | |
#include <botan/hex.h> |
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
QT += core | |
QT -= gui | |
CONFIG += c++11 | |
TARGET = ws_test | |
CONFIG += console | |
CONFIG -= app_bundle | |
TEMPLATE = app |
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 <QDebug> | |
QString generateIpFromInteger(quint32 ip) | |
{ | |
QString ipString; | |
for (int i = 0; i < 4; ++i) { | |
ipString.insert(0, QString::number(ip & 0xff)); | |
if (i < 3) { |
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
QVariant loadJson(const QString &path) | |
{ | |
QFile file(path); | |
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { | |
throw Exception(QStringLiteral("Could not open file")); | |
} | |
QByteArray input = file.readAll(); | |
file.close(); |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <chrono> | |
#include <ratio> | |
// NOTE source: https://www.fluentcpp.com/2018/01/12/how-is-stdset_difference-implemented/ | |
template<typename InputIterator1, typename InputIterator2, typename OutputIterator> | |
OutputIterator mySetDifference(InputIterator1 first1, InputIterator1 last1, |
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
#!/bin/bash | |
# source: https://stackoverflow.com/questions/10929453/read-a-file-line-by-line-assigning-the-value-to-a-variable | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
rm -rf $line | |
done < "$1" |
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
Download the requested version: https://github.com/google/googletest/releases | |
tar -xzvf <GTEST-FOLDER>.tar.gz | |
cd <UNZIPPED-FOLDER> | |
mkdir build | |
cd build | |
cmake -G"Unix Makefiles" .. # By default the CMake try to identify the system so the -G"Unix Makefiles" optionally | |
make install # If needed use super user previlige |
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
#!/bin/bash | |
# checkout the target branch | |
# ./multiple-branch-rebase.sh <branch1> <branch2> ... | |
set -e | |
TARGET_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
for BRANCH in "$@"; do |
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
https://git-scm.com/docs/git-bisect | |
https://dockyard.com/blog/2016/07/26/how-to-bisect-ember | |
example | |
cd <git directory> | |
git bisect start | |
git bisect bad // this command will assume the HEAD in this case | |
git bisect good <commit id of a good commit> | |
git bisect run ./<arbitrary scrip> | |
e.g. | |
``` |
OlderNewer