Shortcut | Explanation |
---|---|
!! | Last command |
!:n | Last command’s nth argument |
!* | Last command’s arguments |
!$ | Last command’s last argument |
!:m-n | Last command’s mth through nth arguments |
!:n- | Last command’s nth through second-to-last arguments |
!:n-$ | Last command’s nth through last arguments |
!:n* | Last command’s nth through last arguments |
This file contains 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 | |
# Show last 10 tags by creation date | |
git for-each-ref --sort=-creatordate refs/tags --format='%(refname:lstrip=2)' --count=10 |
This file contains 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 ora from 'ora' | |
const spinner = ora({ | |
text:'Emoji', | |
spinner: { | |
frames: Array(76).fill(0).map((_,i) => String.fromCodePoint(128516+i)), | |
interval: 100 | |
} | |
}).start() |
This file contains 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
Search: \.?(?<column>[\w_]+) as \k<column> | |
replace: .$1 |
This file contains 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
changeBackground () | |
{ | |
gsettings set org.gnome.desktop.background picture-uri file://`ls /home/sam/Documents/Wallpapers/*.jpg | shuf -n 1` | |
} |
This file contains 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
int GetWeekNumberOfMonth(DateTime date) | |
{ | |
date = date.Date; | |
DateTime firstMonthDay = new DateTime(date.Year, date.Month, 1); | |
return (date - firstMonthDay).Days / 7 + 1; | |
} |
This file contains 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
{"lastUpload":"2019-08-30T20:08:34.891Z","extensionVersion":"v3.4.2"} |
This file contains 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
slice-of-the-month () | |
{ | |
curl -s -L https://www.lucysnypizza.com/specials | grep --color=auto h2 | perl -pe 's/<[^>]*>//g' | perl -ne 'print if /slice.*month/i' | perl -pe 's/.*: (.+)$/$1/' | |
} |
This file contains 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
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ('column_name') AND TABLE_SCHEMA = 'table_name'; |
This file contains 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
# Add below line to .bashrc then source .bashrc | |
gnome-shell-extension-cl -l | egrep "pomodoro|TopIcons|caffeine|openweather|EasyScreen|deskchange|pomodoro" | awk '{print $1}' | xargs -L1 gnome-shell-extension-cl -e | |
# if gnome-shell-extension-cl is missing do: | |
# sudo wget https://raw.githubusercontent.com/cyberalex4life/gnome-shell-extension-cl/master/gnome-shell-extension-cl -O /usr/local/bin/gnome-shell-extension-cl && sudo chmod +x /usr/local/bin/gnome-shell-extension-cl | |
NewerOlder