Skip to content

Instantly share code, notes, and snippets.

Avatar

Tharindu Sathischandra tharindusathis

View GitHub Profile
View archlinux_install_vs_code_official
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
@tharindusathis
tharindusathis / 56-language-selector-si.conf
Created Apr 4, 2021
Replace default font for Sinhala lang - ubuntu
View 56-language-selector-si.conf
<?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>
@tharindusathis
tharindusathis / chrome_command_line_args.md
Created Feb 15, 2021
Chromium command line arguments
View chrome_command_line_args.md

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]

@tharindusathis
tharindusathis / git-commands.txt
Last active Feb 11, 2021
Favourite git commands.
View git-commands.txt
# 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
View .bashrc_my_ext.sh
#!/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"'
@tharindusathis
tharindusathis / source.cpp
Created Jun 27, 2020
my c++ starter template ##cpp ##competitive
View source.cpp
#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)
@tharindusathis
tharindusathis / MainController.java
Created Jun 27, 2020
Drag an undecorated window of JavaFX ##javafx
View MainController.java
@FXML
private StackPane parentPane;
double xOffset;
double yOffset;
@FXML
void handleOnMouseDraggedBtnCtrlMainView(MouseEvent event) {
Stage stage = ( Stage ) parentPane.getScene().getWindow();
stage.setX(event.getScreenX() + xOffset);
@tharindusathis
tharindusathis / TempDeserializer.java
Created Jun 25, 2020
temporary deserializer ##spring ##java ##deserializer
View TempDeserializer.java
public class AnimalDeserializer extends StdDeserializer<Animal>
{
@Autowired
ObjectMapper mapper;
public AnimalDeserializer( Class<?> vc, ObjectMapper mapper )
{
super( vc );
this.mapper = mapper;
}
@tharindusathis
tharindusathis / BeanDeserializerModifier_modifyDeserializer.java
Last active Jun 25, 2020
[BeanDeserializerModifier modifyDeserializer] #spring #jackson
View BeanDeserializerModifier_modifyDeserializer.java
private static ObjectMapper configureObjectMapper(
ObjectMapper objectMapper, boolean shouldIncludeRawResponses) {
if (shouldIncludeRawResponses) {
SimpleModule module = new SimpleModule();
module.setDeserializerModifier(new BeanDeserializerModifier() {
@Override
public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config,
BeanDescription beanDesc,
JsonDeserializer<?> deserializer) {
if (Response.class.isAssignableFrom(beanDesc.getBeanClass())) {