Skip to content

Instantly share code, notes, and snippets.

@tsathis
tsathis / gdb_cheat_sheet.txt
Last active June 5, 2023 11:40
GDB cheat sheet
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
‎‎​
cd ~
git clone https://AUR.archlinux.org/visual-studio-code-bin.git
cd visual-studio-code-bin/
makepkg -s
sudo pacman -U visual-studio-code-bin-*.pkg.tar.zst
@tsathis
tsathis / py.json.md
Created February 13, 2022 07:07
dont-google-it-again

‎‎​

@tsathis
tsathis / 56-language-selector-si.conf
Created April 4, 2021 07:23
Replace default font for Sinhala lang - ubuntu
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="lang">
<string>si</string>
</test>
<test qual="any" name="family">
<string>sans-serif</string>
</test>
@tsathis
tsathis / chrome_command_line_args.md
Created February 15, 2021 02:20
Chromium command line arguments

Condition

Explanation

--/prefetch:1[1]

/prefetch:# arguments to use when launching various process types. It has been observed that when file reads are consistent for 3 process launches with the same /prefetch:# argument, the Windows prefetcher starts issuing reads in batch at process launch. Because reads depend on the process type, the prefetcher wouldn't be able to observe consistent reads if no /prefetch:# arguments were used. Note that the browser process has no /prefetch:# argument; as such all other processes must have one in order to avoid polluting its profile. Note: # must always be in [1, 8]; otherwise it is ignored by the Windows prefetcher.

--/prefetch:2[1]

@tsathis
tsathis / git-commands.txt
Last active February 11, 2021 02:26
Favourite git commands.
# update the origin
git remote set-url origin <new-remote>
# add another repo as a submodule
git submodule add <that-repo-url> <folder-name-for-submodule>
# clone with submodules
git clone --recursive <url>
# download All submodules
#!/bin/bash
# hello... just a test function
hello_world() {
echo 'Hello there,' $1
}
# Key bindings
bind '"\C-f":"cd_with_fzf\n"'
bind '"\C-o":"open_with_fzf\n"'
@tsathis
tsathis / source.cpp
Created June 27, 2020 05:40
my c++ starter template ##cpp ##competitive
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) begin((x)), end((x))
#define rall(x) rbegin((x)), rend((x))
#define foru(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
@tsathis
tsathis / MainController.java
Created June 27, 2020 05:27
Drag an undecorated window of JavaFX ##javafx
@FXML
private StackPane parentPane;
double xOffset;
double yOffset;
@FXML
void handleOnMouseDraggedBtnCtrlMainView(MouseEvent event) {
Stage stage = ( Stage ) parentPane.getScene().getWindow();
stage.setX(event.getScreenX() + xOffset);