Skip to content

Instantly share code, notes, and snippets.

View Dragod's full-sized avatar
🎲
Ma le spegnene?

Fabio Dragod

🎲
Ma le spegnene?
View GitHub Profile
@Dragod
Dragod / winget-on-bash.md
Created September 29, 2021 17:58
Make winget work on bash

Enable windows subsystem in powershell

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Ebable virtual machine feature in powershell

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
@Dragod
Dragod / add-to-gitignore.md
Last active September 22, 2021 10:31
Remove exsisting file/repo and add it to .gitignore

Remove a file from the repo and add it to .gitignore

git rm --cached resources/sprite/dist/sprite.svg

Remove a all file from a folder in a repo and add it to .gitignore

git rm -r --cached resources/sprite/svgo

@Dragod
Dragod / yt-rss.sh
Last active December 15, 2022 22:20
Get youtube feed rss link
#!/bin/bash
#Script to get rss feed from special youtube links.
# Examples:
# 1) https://www.youtube.com/c/NumeroDiez --> type "./yt-rss Numerodiez c" and press enter to get RSS url
# 2) https://www.youtube.com/user/simoneaversano --> type "./yt-rss simoneaversano user" and press ENTER to get RSS url
# If the channel already have an id in the youtube url use:
# 2) https://www.youtube.com/channel/UCk8gzAOGprcGAFMWGzZ2zQw --> type "./yt-rss UCk8gzAOGprcGAFMWGzZ2zQw channel" and press ENTER to get RSS url
GREEN=`tput setaf 2`
@Dragod
Dragod / .gitconfig
Created May 6, 2021 12:54
Add git lb to list of commands available
[alias]
lb = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'
@Dragod
Dragod / .bashrc
Last active May 6, 2021 12:50
2021 .bashrc
green='\e[32m'
blue='\e[34m'
clear='\e[0m'
#Green
GREEN=`tput setaf 2`
# Red
@Dragod
Dragod / .bashrc
Last active May 6, 2021 12:52
Create and delete feature branch from dev
# Create new feature branch from sd-unity-4-0 dev branch
# Red
RED='\033[0;31m'
# Color Function
alert(){
echo -ne $RED$1$clear
@Dragod
Dragod / build.sh
Created April 27, 2021 17:21
Create build.js from bash script
#!/bin/bash
FILE=build.js
if test -f "$FILE"; then
printf "\r\n$FILE already exists, start use node build with \"node build --cmd\"\n"
else
echo "let build = require('sd-unity-build');" > build.js
printf "\r\nbuild.js created, start use node build with \"node build --cmd\"\n"
fi
@Dragod
Dragod / last-commit-date-on-branch.sh
Created April 1, 2021 11:02
Date of last commint on branches
git for-each-ref --sort='-committerdate' --format='%(refname)%09%(committerdate)' refs/heads | sed -e 's-refs/heads/--'
@Dragod
Dragod / worked-on-banch-list.sh
Created April 1, 2021 11:01
Show most recently worked on branches
git for-each-ref --sort=-committerdate refs/heads/
@Dragod
Dragod / .bashrc
Created February 2, 2021 07:47
.bashrc to run node build on unity
green='\e[32m'
blue='\e[34m'
clear='\e[0m'
#Green
GREEN=`tput setaf 2`
# Red