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 / win32-open
Created February 19, 2020 17:21
A WSL replacement for xdg-open
#!/bin/bash
if [[ ! -f /proc/version ]] && grep -Pq '[Mm]?icrosoft' /proc/version; then
echo "Only works with WSL"
exit 1
fi
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Start-Process -FilePath "$@" -Verb open
@SirJson
SirJson / ignoreman.ps1
Last active March 7, 2020 02:40
ignoreman but ported to powershell 7
$gitroot = $args[0]
function gitignoreio() {
# Parameter help description
Param(
[Parameter(Mandatory = $true)]
[String]
$command
)
#!/usr/bin/env python3
"""
usage: git fetchpr <PULL_REQUEST_ID>
Arguments:
PULL_REQUEST_ID The pull request id
If an 'upstream' repository is configured this command can fetch unmerged pull requests to your local repository.
The PULL_REQUEST_ID can be found in on Github upstream pull request page.
#!/bin/bash
ARG1=$1
MSG=${ARG1:-"Update - $(date)"}
function mkcommit()
{
echo "Commit Message: $1"
git commit -am "$1"
}
#!/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}
#!/bin/bash
ARG1=$1
MSG=${ARG1:-"Update - $(date)"}
function mkcommit()
{
echo "Commit Message: $1"
git commit -am "$1"
}
#!/bin/bash
_gen_fzf_default_opts() {
local color00='#263238'
local color01='#2C393F'
local color02='#37474F'
local color03='#707880'
local color04='#C9CCD3'
local color05='#CDD3DE'
local color06='#D5DBE5'
#!/bin/bash
# Create useful gitignore files. Based on gi from fzf examples
# Usage: ignoreman [param]
# param is a comma separated list of ignore profiles.
# If param is ommited choose interactively.
# This version will modify or create a .gitignore file and provide a preview in interactive mode
# I also switched from sh to bash because I couldn't execute this script with sh.
@SirJson
SirJson / nginx-reverse-proxy-template.conf
Last active September 25, 2020 22:54
A template for reverse proxies for nginx
location ~ /app/* {
client_max_body_size 2048m;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
@SirJson
SirJson / explorer
Last active January 21, 2020 12:31
FZF simple file explorer zfunc
A=$PWD
[[ -n $1 ]] && a="$1" || a="$PWD"
cd $a
local dir=$((printf '..\n' && exa -F1a --color=always) | fzf --reverse --exact --ansi --preview="test -f {} && bat --color=always --paging=never --decorations=always --italic-text=always --style=full {} || test -d {} && exa -Fla --color=always {} || echo ''")
test -d "$dir" && explorer $dir
test -f "$dir" && $EDITOR $dir