Skip to content

Instantly share code, notes, and snippets.

View thekingofbandit's full-sized avatar
🏠
Working from home

Mohammad Khanafi thekingofbandit

🏠
Working from home
View GitHub Profile
@thekingofbandit
thekingofbandit / no-css
Created June 27, 2020 17:28 — forked from Kartones/no-css
Bookmark to remove all CSS, JS and iframesfrom a page. Just paste as new bookmark
javascript:%20var%20el,%20i,%20size;%20%20for(i=0,%20size=document.styleSheets.length;%20i<size;%20i++)%20{%20void(document.styleSheets.item(i).disabled=true);%20}%20%20el%20=%20document.getElementsByTagName('script');%20%20while%20(el.length%20>%200)%20{%20%20void(el[0].parentNode.removeChild(el[0]));%20%20}%20%20el%20=%20document.getElementsByTagName('link');%20%20while%20(el.length%20>%200)%20{%20%20void(el[0].parentNode.removeChild(el[0]));%20%20}%20%20el%20=%20document.getElementsByTagName('iframe');%20%20while%20(el.length%20>%200)%20{%20%20void(el[0].parentNode.removeChild(el[0]));%20%20}%20%20el%20=%20document.getElementsByTagName('*');%20%20for%20(%20i=0,%20size=el.length;%20i%20<%20size;%20i++)%20{%20%20void(el[i].style.cssText%20=%20'');%20%20}
@thekingofbandit
thekingofbandit / imagemagick.md
Created June 27, 2020 17:27 — forked from Kartones/image-and-video.md
Imagemagick & ffmpeg commands

imagemagick

  • Nornalize all images of a folder converting them to jpgs with 90% quality (warning, removes original files):
rename 's/\.JPG$/\.jpg/' *.JPG
rename 's/\.JPEG$/\.jpg/' *.JPEG
rename 's/\.jpeg$/\.jpg/' *.jpeg
mogrify -format jpg *.png
mogrify -resize 1600x1280\> -quality 90 *.jpg
rm *.png
@thekingofbandit
thekingofbandit / postgres-cheatsheet.md
Created June 27, 2020 17:26 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)