This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>otplib demo</title> | |
<script src="https://unpkg.com/@otplib/preset-browser@^12.0.0/buffer.js"></script> | |
<script src="https://unpkg.com/@otplib/preset-browser@^12.0.0/index.js"></script> | |
<script type="text/javascript"> |
This file contains hidden or 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://godbolt.org/z/7WW5vTsaY | |
#include <chrono> | |
#include <fmt/format.h> | |
#include <fmt/chrono.h> | |
int main() | |
{ | |
const auto now = std::chrono::system_clock::now(); | |
const auto now_sec = std::chrono::time_point_cast<std::chrono::seconds>(now); |
This file contains hidden or 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 | |
set -e | |
ORG="" | |
REPOS="$(gh repo list "$ORG" --json name --jq '.[] | join("")')" | |
NODEJS12_DEPRECATION_MSG="Node.js 12 actions are deprecated." | |
for REPO in $REPOS; do | |
echo -n "$ORG/$REPO " |
This file contains hidden or 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
((Get-NetTCPConnection -State Listen | Select-Object -Property LocalPort | ConvertTo-csv -NoTypeInformation | Select-Object -skip 1) -join ",") -replace '"' | |
# List IPv4 listening local ports | |
(Get-NetTCPConnection -State Listen | Where-Object -Property LocalAddress -NotContains '::' | Select-Object -Property LocalPort | ConvertTo-csv -NoTypeInformation | Select-Object -skip 1 -Unique) -replace '"' |
This file contains hidden or 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 | |
# uninstall existing cppcheck | |
sudo apt purge cppcheck -y | |
# download, build and install | |
cd ~/Downloads | |
wget https://github.com/danmar/cppcheck/archive/refs/tags/2.11.tar.gz | |
tar -xvf 2.11.tar.gz | |
cd cppcheck-2.11 |
This file contains hidden or 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
require 'zstd' | |
module Fluent::Plugin | |
class S3Output | |
class LZMA2Compressor < Compressor | |
S3Output.register_compressor('zstd', self) | |
def initialize(options = {}) | |
begin | |
require 'zstd' |
This file contains hidden or 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 | |
set -e | |
owner="" # owner name here | |
repo="" # repo name here | |
prs=$(gh pr list --repo "$owner/$repo" --json number --jq '.[] | join("")') | |
for pr in $prs; do |
This file contains hidden or 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/Microsoft/vcpkg.git | |
cd vcpkg | |
./bootstrap-vcpkg.sh | |
./vcpkg search sqlite3 | |
./vcpkg install sqlite3[tool] | |
# headers, static library, and command-line tool | |
$ tree installed/x64-linux/{include,lib,tools} |
This file contains hidden or 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 | |
set -e | |
if [[ -z $GITHUB_ACTOR || -z $GITHUB_TOKEN || -z $GITHUB_REPOSITORY ]]; then | |
echo "[ERR] Run $0 under GitHub Actions context!" | |
exit 1 | |
fi | |
IMAGE_NAME=${1:-''} |
This file contains hidden or 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 <iomanip> | |
#include <sstream> | |
#include <chrono> | |
#include <ctime> | |
std::string get_timestamp() noexcept | |
{ | |
const auto now = std::chrono::system_clock::now(); | |
const auto time = std::chrono::system_clock::to_time_t(now); |
NewerOlder