Skip to content

Instantly share code, notes, and snippets.

View SirJson's full-sized avatar
:electron:
Am Heimcomputer sitz' ich hier, und programmier' die Zukunft mir

Raffael Zica SirJson

:electron:
Am Heimcomputer sitz' ich hier, und programmier' die Zukunft mir
View GitHub Profile
@SirJson
SirJson / Theme.css
Last active April 8, 2019 14:43
Material Fonts and Sizes for fman + HiDPI fix. Version 3. Includes the SCSS source file with all my notes and the resulting CSS file for use in fman. Note: I did not update the source scss file yet.
* {
font-family: Roboto, Noto Sans, Segoe UI, Ubuntu, sans-serif;
font-size: 12pt;
font-weight: normal;
}
th {
vertical-align: center;
font-size: 10pt;
padding-top: 8px;
@SirJson
SirJson / PKGBUILD
Created April 13, 2019 20:42
Boostnote-0.11.15 Build patch
# Maintainer: Jannick Hemelhof <mister {dot} jannick {at} gmail {dot} com>
# Contributor: Nicola Squartini <tensor5 {at} gmail {dot} com>
# Contributor: NicoHood <aur {at} nicohood {dot} de>
# Contributor: Dick Choi <fluke8259 {at} gmail {dot} com>
# Contributor: Romain Bazile <gromain {dot} baz {at} gmail {dot} com>
pkgname=boostnote
_pkgname=Boostnote
pkgver=0.11.15
pkgrel=1
pkgdesc="Open source note-taking app for programmers"
@SirJson
SirJson / ssh-id-copy.ps1
Last active November 28, 2019 17:38
ssh-id-copy clone for Windows 10
# ssh-id-copy for Windows. Works the same except the only supported parameter are -i and -p
function Copy-SshId {
param (
[string]$destination,
[string]$i,
[string]$p
)
if ($i -eq "" -and $i -eq [String]::Empty) {
$sshdir = Get-ChildItem -Path "~/.ssh"
$pubkey = $sshdir | Where-Object { $_.extension -eq ".pub" } | Select-Object -First 1
@SirJson
SirJson / profiles.json
Created December 20, 2019 16:19
My Windows Terminal Theme collection
"schemes": [
{
"name": "Dracula",
"background": "#272935",
"black": "#272935",
"blue": "#BD93F9",
"brightBlack": "#555555",
"brightBlue": "#BD93F9",
"brightCyan": "#8BE9FD",
"brightGreen": "#50FA7B",
@SirJson
SirJson / git-status-all.sh
Last active December 22, 2019 19:07
Prints a "status" list of all subfolder that are controlled by git
#!/bin/bash
CYAN=$(tput setaf 6)
BOLD=$(tput bold)
RESET=$(tput sgr0)
echo "> Searching for git directories..."
find . -name ".git" -type d | while read dir; do
echo "-----"
echo -e Git status @ ${CYAN}${BOLD}${dir/.git/}${RESET}
@SirJson
SirJson / smbshare.py
Created January 1, 2020 04:14
Python script based on prompt_toolkit for easy samba share mounting on Linux systems
#!/usr/bin/env python3
import os
import json
from pathlib import Path
from prompt_toolkit import prompt, print_formatted_text, HTML
from prompt_toolkit.completion import FuzzyWordCompleter
CFG_TEMPLATE="""
{
@SirJson
SirJson / .tmux.conf
Created January 1, 2020 05:22
My Tmux Conf
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
@SirJson
SirJson / exec-x11wsl
Last active January 1, 2020 11:33
Launcher script for x11 applications running inside WSL 2
#!/bin/bash
[[ -f $HOME/.profile ]] && source $HOME/.profile
[[ -f $HOME/.zprofile ]] && source $HOME/.zprofile
INTERNALIP=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}')
DBUSPID=$(pidof dbus-launch)
sh -ic "if [ -z $DBUSPID ]; then export DISPLAY=$INTERNALIP:0.0; dbus-launch --exit-with-x11; fi;"
export DISPLAY=$INTERNALIP:0.0
$@
@SirJson
SirJson / git-goto
Created January 8, 2020 22:28
Switch to a git branch or tag. Improved version of fco_preview() from the fzf example page.
#!/bin/bash
BRANCHES=$(git --no-pager branch --all --format="%(if)%(HEAD)%(then)%(else)%(if:equals=HEAD)%(refname:strip=3)%(then)%(else)%1B[0;34;1mbranch%09%1B[m%(refname:short)%(end)%(end)" | sed '/^$/d') || exit 1
TAGS=$(git --no-pager tag | awk '{print "\x1b[35;1mtag\x1b[m\t" $1}') || exit 1
test -z "$TARGET" && test -z "$TAGS" && exit 1
TARGET=$((echo "$BRANCHES"; test ! -z "$TAGS" && echo "$TAGS") | fzf --no-multi -n 2 --ansi --no-hscroll --layout=reverse-list --header='Checkout git branch/tag, with the preview showing the commits between the tag/branch and HEAD' --preview="printf '\e[4m\e[94mCommits between your selection and HEAD\e[0m\n\033[36mCurrent branch:\e[0m ';git rev-parse --abbrev-ref HEAD;printf '\n';git --no-pager log -150 --pretty=format:'• [%cr] <%h>: %s' '..{2}'") || exit 0
git checkout $(awk '{print $2}' <<<"$TARGET" )
@SirJson
SirJson / profiles.json
Created January 14, 2020 18:20
Open PowerShell as Admin from Windows Terminal
{
"guid": "{5d1b6039-0bee-447e-9b5a-49bea3db730d}",
"name": "PowerShell Admin",
"commandline": "pwsh -ec UwB0AGEAcgB0AC0AUAByAG8AYwBlAHMAcwAgAC0ARgBpAGwAZQBQAGEAdABoACAAIgBwAHcAcwBoACIAIAAtAFYAZQByAGIAIABSAHUAbgBBAHMAOwBlAHgAaQB0ACAAMAA="
}