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
#pragma once | |
namespace utils | |
{ | |
template<class T> | |
void enumByChunk(const typename T::const_iterator& cbegin, const typename T::const_iterator& cend, const size_t chunkSize, | |
const function<void(const typename T::const_iterator& sub_begin, const typename T::const_iterator& sub_end)>& func) | |
{ | |
auto it = cbegin; | |
while (it < cend) |
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
#pragma once | |
#include <string> | |
#include <chrono> | |
namespace chrono = std::chrono; | |
using hrclock = chrono::high_resolution_clock; | |
namespace utils | |
{ | |
class PerfCounter |
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
#pragma once | |
#include <filesystem> | |
#include <boost/interprocess/sync/file_lock.hpp> | |
#include <boost/interprocess/sync/scoped_lock.hpp> | |
using std::ofstream; | |
using std::filesystem::path; | |
using boost::interprocess::file_lock; | |
using boost::interprocess::scoped_lock; |
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
import json | |
def read_json(json_file): | |
with open(json_file, 'r', encoding='utf-8') as fi: | |
return json.load(fi) | |
def write_json(obj, json_file): | |
with open(json_file, 'w', encoding='utf-8') as fo: | |
json.dump(obj, fo) | |
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
import subprocess | |
def get_tag(): | |
return subprocess.check_output(['git', 'describe', '--always'], cwd='json', encoding='utf-8').strip() |
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
def zip(zip_file, src_dir): | |
with zipfile.ZipFile(zip_file, 'w') as zipObj: | |
for folderName, subfolders, filenames in os.walk(src_dir): | |
for filename in filenames: | |
# create complete filepath of file in directory | |
filePath = os.path.join(folderName, filename) | |
zipObj.write(filePath, osp.relpath(filePath, src_dir)) |
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
# add to ~/.aws/config and add the path to your folder. | |
[profile vscode] | |
region = us-west-2 | |
credential_process = /home/ec2-user/.aws/get_credentials_vscode.sh |
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
from typing import Optional, Union | |
import jsii | |
from aws_cdk import ( | |
aws_ec2 as ec2, | |
aws_rds as rds, | |
aws_kms as kms, | |
aws_secretsmanager as secretsmanager, | |
core, | |
) |
This file has been truncated, but you can view the full file.
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
C:\Data2>git config --global --list | |
fatal: unable to read config file 'C:/Users/Administrator.ECS-BASE-WIN-20/.gitconfig': No such file or directory | |
C:\Data2>git config --system --list | |
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt | |
http.sslbackend=openssl | |
diff.astextplain.textconv=astextplain | |
filter.lfs.clean=git-lfs clean -- %f | |
filter.lfs.smudge=git-lfs smudge -- %f | |
filter.lfs.process=git-lfs filter-process |
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
copy %userprofile%\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\*.* %userprofile%\Pictures\Windows_LockScreen | |
cd /d %userprofile%\Pictures\Windows_LockScreen | |
ren * *.jpg |
NewerOlder