Skip to content

Instantly share code, notes, and snippets.

View pranjalpokharel7's full-sized avatar

Pranjal Pokharel pranjalpokharel7

View GitHub Profile
@pranjalpokharel7
pranjalpokharel7 / snippets.md
Created January 9, 2022 15:05
A Collection of Snippets

A Collection of Snippets

Probably useful, or not. But I keep forgetting them so I'm storing them all in a gist for now.

Resize all images in a folder using imagemagick

Very useful for uploading assignment photos online.

$ magick mogrify -resize 70% *.jpg

file_splitter.sh

This is a simple bash script to split a file into pieces based on provided file size and encrypt the chunks individually.

The script also provides option to decrypt them and re-combine them. Useful in cases you want to upload/download files over an insecure connection with limited upload/download size limit.

#!/bin/bash

file_organizer.sh

This is a simple script to organize files in a directory, based on

  1. File extension
  2. File name
#!/bin/bash

function organize_by_extension(){
@pranjalpokharel7
pranjalpokharel7 / vim_theme_switcher.md
Last active March 2, 2021 05:28
Vim Auto Theme Switcher (dark<->light)

vim_theme_switcher

This is a simple script to switch color scheme in vim from light to dark and vice-versa depending upon system time. The script is written in bash.

#!/bin/bash

# vim_theme_switcher.sh
@pranjalpokharel7
pranjalpokharel7 / lab_cover_page.tex
Last active March 4, 2021 07:06
Latex code to generate cover page for lab reports.
% This is a gist to generate cover page for lab reports.
% Based on the layout we usually need to use as engineering students.
% Output: https://drive.google.com/file/d/16eNLZ0Vcf6K79jPwpKj6qzJ1O54koLU8/view?usp=sharing
% Add Tribhuwan University (TU) logo named 'TU-logo.png' (jpg/pdf) inside './images/'
% directory relative to root. You can download and include your own logo in the
% directory (set paths + filename correctly).
% Adjust the logo scale factor from \newcommand\logoScaleFactor{<your-scale-factor>}
% The logo I have used can be downloaded from the following drive link -
% Logo: https://drive.google.com/file/d/1OVkWmZXikLdYjIFgPGpvKb8-1HHSFQS4/view?usp=sharing