Skip to content

Instantly share code, notes, and snippets.

View trungnt13's full-sized avatar
:octocat:
Coding, coding, ... and still coding

TrungNT trungnt13

:octocat:
Coding, coding, ... and still coding
View GitHub Profile
@trungnt13
trungnt13 / example.rs
Created April 21, 2024 11:53 — forked from ethanhs/example.rs
Example using pickling in pyo3
#![feature(arbitrary_self_types)]
use pyo3::prelude::*;
use pyo3::pyclass::PyClassShell;
use pyo3::types::{PyBytes, PyTuple};
use pyo3::ToPyObject;
use bincode::{deserialize, serialize};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
@trungnt13
trungnt13 / UbuntuLinux.md
Last active December 24, 2023 09:01
[CheatSheet] Ubuntu Linux
@trungnt13
trungnt13 / tmux_linux.conf
Last active September 9, 2023 09:33
tmux_linux.conf
# 09Sep23 v1
# https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/ea9293953796d78b8b93e67e046a5583c6cc6d39/tmux_linux.conf
# 09Sep23 v2
# https://gist.githubusercontent.com/trungnt13/34a8b101ab7fe14f7f0f194d1f63ad6c/raw/51dc5214e47d648039dffe83908e603ab07bf9c2/tmux_linux.conf
set -g history-limit 100000
## Change background and border of active pane
set-option -g pane-border-style fg=default,bg=default
set-option -g pane-active-border-style fg=red,bg=default
@trungnt13
trungnt13 / regex.md
Last active July 19, 2023 13:16
[CheatSheet] regular expression regex

Regular Expressions


Python Regex

Basics:

  • . any character, except newline characters.
  • \d, \w, and \s a digit, word, or space character, respectively.
  • \D, \W, and \S anything except a digit, word, or space, respectively.
@trungnt13
trungnt13 / FoamDateFormat.md
Last active May 18, 2023 17:50
[CheatSheet] Foam / Node Date Format

DateFormat

Node date format

Foam Daily Note

These settings can be overridden in your workspace or global .vscode/settings.json file, using the dateformat date masking syntax:

Template at .foam/templates/daily-note.md

@trungnt13
trungnt13 / GitCheatSheet.md
Last active April 17, 2024 09:40
[CheatSheet] Git common workflow and command, Precommit
@trungnt13
trungnt13 / c_cpp_properties.json
Last active April 24, 2023 21:52
[VSCode] C/C++ c_cpp_properties.json
// env: an array of user-defined variables for substitution in configurations
// configurations: an array of configuration objects for IntelliSense engine
// version: tracks current version of c_cpp_properties.json file
{
"env": {
"myDefaultIncludePath": [
"${workspaceFolder}",
"${workspaceFolder}/include"
],
"myCompilerPath": "/usr/local/bin/gcc-7"
@trungnt13
trungnt13 / AzureFunctionHost.json
Created April 18, 2023 18:30
[Ref] Azure Function host.json
// https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json
{
"version": "2.0",
// Specifies how many function invocations are aggregated when calculating metrics for Application Insights.
"aggregator": {
"batchSize": 1000,
"flushTimeout": "00:00:30"
},
"concurrency": {
"dynamicConcurrencyEnabled": true,
@trungnt13
trungnt13 / QuietLightVSCode.json
Created April 17, 2023 11:52
[Ref] Quiet Light Theme VSCode
{
"author": "Ian Beck",
"comment": "Light, peaceful coding.",
"name": "Quiet Light for VSC",
"tokenColors": [
{
"name": "Comments",
"scope": [
"comment",
"punctuation.definition.comment"