Skip to content

Instantly share code, notes, and snippets.

View serpro69's full-sized avatar
🍵
breaking things 🔨 bit by bit 0️⃣1️⃣

Serhii P. serpro69

🍵
breaking things 🔨 bit by bit 0️⃣1️⃣
View GitHub Profile
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html
Checkstyle is very configurable. Be sure to read the documentation at
@serpro69
serpro69 / filtering_dv.js
Created January 5, 2024 09:09 — forked from scottTomaszewski/filtering_dv.js
This DataviewJS View helps to add filtering functionality to a Dataview Table in Obsidian.
/*
This DataviewJS View helps to add functionality to a Dataview Table.
THIS IS A BETA RELEASE - there are bugs and its not feature-complete
Version: v0.6.0
Given a Dataview Query, this view will
- Execute the query
- Extract the headers/columns of the result
- Render filters to adjust the Dataview table results
- Render the table results, filtering and re-rendering on filter changes
@serpro69
serpro69 / canvas_diamond.css
Created September 6, 2023 12:02
obsidian canvas diamond shape
.canvas-node-container:has(.diamond) {
transform:rotate(42deg);
overflow: visible;
contain: none;
position: absolute;
width: 150px;
height: 150px;
}
.canvas-node-content:has(.diamond) {
@serpro69
serpro69 / install_virtualenv.sh
Created July 14, 2023 18:43
python+virtualenv
#!/usr/bin/env bash
# TODO convert to a role in https://github.com/serpro69/ansible-collection-devexp
# installs https://virtualenv.pypa.io/en/latest/index.html
# requires pipx - https://pypi.org/project/pipx/
# pipx install virtualenv
# pip install --user --no-deps virtualenvwrapper # use no-deps to skip installing virtualenv via pip since it's installed via pipx
# export
@serpro69
serpro69 / install_guake.sh
Last active July 14, 2023 18:44
guake installation on popos (ubuntu 22.04)
#!/usr/bin/env bash
# TODO convert to a role in https://github.com/serpro69/ansible-collection-devexp
# https://guake.readthedocs.io/en/latest/user/installing.html#install-from-pypi
is_not_root() {
[ "${EUID:-$(id -u)}" -ne 0 ]
}
# rsync-homedir-excludes
#
# A list of files to exclude when backing up *nix home directories using rsync.
#
# Author: Ruben Barkow-Kuder <https://github.com/rubo77/rsync-homedir-excludes>
# Version: 2019-11-30
#
# #Usage:
# USER=<homedir username here>
# rsync -aP --exclude-from=rsync-homedir-excludes.txt /home/$USER/ /media/$USER/linuxbackup/home/$USER/
@serpro69
serpro69 / dvGoalsProgress.js
Last active February 16, 2023 11:44
obsidian dataview goals tracker
/**
Tracks mission-related KPIs (goals) targets from daily notes.
Daily notes' frontmatter structure:
```
---
mission:
220_01_332:
water: 2000
```dataviewjs
// find dates based on format [[YYYY-MM-DD]]
const findDated = (task)=>{
if( !task.completed ) {
task.link = " " + "[[" + task.path + "|*]]";
task.date="";
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/);
if(found) task.date = moment(found[1]);
return true;
}
@serpro69
serpro69 / Hypothesidian.js
Created January 28, 2023 20:51 — forked from TfTHacker/Hypothesidian.js
Hypothes.is - retrieve your annotations into Obsidian (for templater plugin)
<%*
/*
# Hypothes.idian a templater script for retrieving annotations from Hypothes.is
Dev: TfTHacker https://twitter.com/TfTHacker
# Prerequisites:
+ Templater plugin by https://github.com/SilentVoid13/Templater
+ Free Hypothes.is developer token from: https://hypothes.is/account/developer
+ This script will prompt you for his token and save it to a file called "hypothesis config.md"
+ This file store your configuration and can be located any where in your vault.
@serpro69
serpro69 / dataview-query.js
Created December 31, 2022 10:24
Obsidian Dataview - display text from header section
let pages = dv.pages('#daylog');
// Loop through pages
for (let p of pages) {
let noteText = await dv.io.load(p.file.path);
// define headers to look for
const headers = ["🧭 Personal", "💻 Work"];
headers.map((header) => {