Skip to content

Instantly share code, notes, and snippets.

View cmaspi's full-sized avatar
💧
Idk, drink water ig?

cmaspi cmaspi

💧
Idk, drink water ig?
View GitHub Profile
@cmaspi
cmaspi / SmartPlot.py
Created February 29, 2024 10:51
My Smart plotter to reduce some redundance in code (uses matplotlib)
import matplotlib.pyplot as plt
from typing import List, Tuple
import math
import numpy as np
class SmartPlot:
@staticmethod
def plot_single_image(image,
title,
colorbar=False):
This file has been truncated, but you can view the full file.
THE BOY WHO LIVED Mr and Mrs Dursley of number four Privet Drive were proud to say that they were perfectly normal thank you very much .They were the last people youd expect to be involved in anything strange or mysterious because they just didnt hold with such nonsense .Mr Dursley was the director of a firm called Grunnings which made drills .He was a big beefy man with hardly any neck although he did have a very large mustache .Mrs Dursley was thin and blonde and had nearly twice the usual amount of neck which came in very useful as she spent so much of her time craning over garden fences spying on the neighbors .The Dursley s had a small son called Dudley and in their opinion there was no finer boy anywhere .The Dursleys had everything they wanted but they also had a secret and their greatest fear was that somebody would discover it .They didnt think they could bear it if anyone found out about the Potters .Mrs Potter was Mrs Dursleys sister but they hadnt met for several years in fact Mrs Dursley pretende
@cmaspi
cmaspi / userChrome.css
Last active April 15, 2024 18:23
This file witll center the text in address bar of firefox
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#urlbar-container {
text-align: center !important;
}
@cmaspi
cmaspi / autodelete.service
Created November 4, 2023 06:37
Auto delete files from mentioned directory after 7 days of inactivity
[Unit]
Description=Delete files in the autodelete directory
[Service]
ExecStart=fish /home/cmaspi/.config/fish/functions/autodelete.fish
[Install]
WantedBy=multi-user.target
@cmaspi
cmaspi / sync-notes.fish
Created January 5, 2023 07:21
sync notes in obsidian with github
function sync-notes
set curr_dir (pwd)
cd ~/Obsidian/Research-Summary/
git pull
git add .
git commit -m "$argv"
git push
cd $curr_dir
end
sudo apt update
sudo apt upgrade
sudo apt install vim
sudo apt remove --purge thunderbird
sudo apt remove -y --purge aisleriot gnome-mines gnome-mahjongg
sudo apt autoremove
sudo apt install fish
chsh -s $(which fish)
@cmaspi
cmaspi / pdf.fish
Created May 15, 2022 14:20
This is a function to compile pdflatex with bibtex using a simple fish function, the limitation is that the tex file should be named main.
function pdf --description "It compiles a latex document"
pdflatex main.tex
bibtex main.aux
pdflatex main.tex
pdflatex main.tex
end
@cmaspi
cmaspi / color.txt
Last active March 20, 2022 04:46
This is a list of few colors schemes that can be used in terminal
Black: \u001b[30m
Red: \u001b[31m
Green: \u001b[32m
Yellow: \u001b[33m
Blue: \u001b[34m
Magenta: \u001b[35m
Cyan: \u001b[36m
White: \u001b[37m
Bright Black: \u001b[30;1m
Bright Red: \u001b[31;1m
@cmaspi
cmaspi / fish_prompt.fish
Last active March 16, 2024 14:16
this is my fish prompt
function fish_prompt
set -l last_status $status
if not set -q VIRTUAL_ENV_DISABLE_PROMPT
set -g VIRTUAL_ENV_DISABLE_PROMPT true
end
set_color --bold yellow
printf '%s' $USER
set_color magenta
printf ' in '
@cmaspi
cmaspi / swapInPython.md
Last active May 15, 2022 14:24
swap in python
a,b = b,a

What does it actually do?
Well, it swaps a and b.. the question is how?

Order of Operations

Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side.

In the above line of code, two new objects are created which are reference the same object as b, a respectively. Then, we assign them to a,b. The left side will get assigned first, that is a.