This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sxhkd config for Linux: Command+Arrow keys macOS style shortcut | |
super + @{Left,Right} | |
xte 'keyup Super_L' 'key {Home,End}' | |
super + shift + @{Left,Right} | |
xte 'keyup Super_L' 'key {Home,End}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fetch all branches | |
# From: http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches | |
#!/bin/bash | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | |
git branch --track ${branch##*/} $branch | |
done | |
git fetch --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in cli for local db | |
-Install postgres (one time only for the psql cli tools) | |
-Install pg in the working folder of code(postgres for node) npm install pg | |
-createdb nameofdb | |
-Install knex in the working folder of code npm install knex (-g first time) | |
-knex init (gives you the knexfile -see below) | |
-knex migrate:make 'nameofmigrationsfile' <-- then edit | |
-knex migrate:latest | |
-optional for seeding- knex seed:make 'nameofseedfile' <--then edit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"nome": "Agrigento", | |
"sigla": "AG", | |
"regione": "Sicilia" | |
}, | |
{ | |
"nome": "Alessandria", | |
"sigla": "AL", | |
"regione": "Piemonte" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script require root privileges | |
if [ $EUID != 0 ]; then | |
sudo "$0" "$@" | |
exit $? | |
fi | |
# Parse ARGS | |
POSITIONAL=() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script require root privileges | |
if [ $EUID != 0 ]; then | |
sudo "$0" "$@" | |
exit $? | |
fi | |
# Parse ARGS | |
POSITIONAL=() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export LANG=C | |
output=$1; | |
scale=$2; | |
if [ -n "$output" ] && ! (xrandr --listmonitors | grep -qw "$output"); then | |
echo "Invalid output: '$output'"; | |
exit 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import signal | |
from gi.repository import Gtk as gtk | |
from gi.repository import AppIndicator3 as appindicator | |
APPINDICATOR_ID = 'myappindicator' | |
def main(): | |
indicator = appindicator.Indicator.new(APPINDICATOR_ID, os.path.abspath('sample_icon.svg'), appindicator.IndicatorCategory.SYSTEM_SERVICES) | |
indicator.set_status(appindicator.IndicatorStatus.ACTIVE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://natelandau.com/bash-scripting-utilities/ | |
# | |
# Set Colors | |
# | |
bold=$(tput bold) | |
underline=$(tput sgr 0 1) | |
reset=$(tput sgr0) |
NewerOlder