Skip to content

Instantly share code, notes, and snippets.

View ongun-kanat's full-sized avatar

Ongun Kanat ongun-kanat

  • München, Germany
  • 19:41 (UTC +01:00)
View GitHub Profile
@ongun-kanat
ongun-kanat / static-libstdc++.md
Last active January 27, 2021 17:33
Linking libstdc++ statically in MinGW-w64
target_link_options(mylib PRIVATE -static-libstdc++ -static-libgcc -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive,-Bdynamic)
@ongun-kanat
ongun-kanat / aur_search_browser.xml
Created November 15, 2020 22:50
AUR Search on browser
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>AUR</ShortName>
<Description>Search PKGBUILDS in AUR</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image height="16" width="16">https://aur.archlinux.org/favicon.ico</Image>
<Url type="text/html" method="GET" template="https://aur.archlinux.org/packages/?K={searchTerms}"/>
<Url type="application/x-suggestions+json" method="GET" template="https://aur.archlinux.org/rpc?type=suggest&amp;arg={searchTerms}"/>
</OpenSearchDescription>
@ongun-kanat
ongun-kanat / misuse_scale.md
Last active April 19, 2020 02:13
A fun but quite realistic scale for software quality: The Misuse Scale.

How Do I Make This Hard to Misuse?

It's useful to arm ourselves with a pithy phrase should we ever have to face an "it'll be easier to use!" argument. But once we've pointed to it, it's still not clear how to improve the difficulty of interface misuse.

So I've created a "best" to "worst" list: my hope is that by putting "hard to misuse" on one axis in our mental graphs, we can at least make informed decisions about tradeoffs like "hard to misuse" vs "optimal". The Hard To Misuse Positive Score List

10. It's impossible to get wrong.

@ongun-kanat
ongun-kanat / 00-overrides.conf
Last active April 11, 2024 13:12
Make ~~cancer~~ emoji work on Linux
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>Arial</family>
<prefer>
<family>Arial</family>
<family>Liberation Sans</family>
<family>sans-serif</family>
</prefer>
@ongun-kanat
ongun-kanat / shellline.sh
Created September 20, 2018 20:51
shellline
function git_branch_check {
branch=$(git branch 2>/dev/null | sed -n -e 's/^\* \(.*\)/\1/p')
if [ -z "$branch" ]; then
echo -e '\001\e[0;38;5;223;48;5;29m\002\001\e[1;38;5;15;48;5;29m\002'
else
echo -e '\001\e[0;38;5;223;48;5;166m\002\001\e[1;38;5;15;48;5;166m\002  '$branch' \001\e[0;38;5;166;48;5;29m\002\001\e[1;38;5;15;48;5;29m\002'
fi
}
user_block_start=$(if [[ ${EUID} == 0 ]]; then echo '\001\e[0;38;5;231;48;5;9;1m\002'; else echo '\001\e[0;38;5;231;48;5;31;1m\002'; fi)

How metadata is extracted in Information Panel

  1. Dolphin creates Baloo::FileMetadataWidget
  2. When a single file is clicked Baloo::FileMetadataWidget::setItems is called by Dolphin
  3. The class Baloo::FileMetaDataWidget uses Baloo::FileMetaDataProvider to create a filling job
  4. Then Baloo::FileMetaDataProvider::setFileItem is called and creates an Baloo::IndexedDataRetriever instance.
  5. Then, Baloo::IndexedDataRetriever creates a process using executable baloo_filemetadata_temp_extractor which prints the results gathered by KFileMetaData extractors and Baloo::IndexedDataRetriever reads the standart output.
  6. The results are returned and merged with standard fields and printed in the widget