Skip to content

Instantly share code, notes, and snippets.

View adhiraj2001's full-sized avatar

Adhiraj Deshmukh adhiraj2001

View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 26, 2024 07:44
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@musale
musale / fix.md
Last active May 31, 2024 19:41
How to fix and recover a “corrupt history file” in zsh
# move to home directory
cd ~

# move the .zsh_history file into another .zsh_history_bad file
mv .zsh_history .zsh_history_bad

# write all printable strings into a new .zsh_history file
strings .zsh_history_bad > .zsh_history

VimWiki Cheatsheet

[number] refers to the wiki number, set by the order in your vimrc. The default is 1.

Wiki Management

  • [number] <leader> ww - open wiki index file
  • [number] <leader> wt - open wiki index file in new tab
  • <leader> ws - list and select available wikis
  • wd - delete wiki page
@tdgunes
tdgunes / Info.md
Last active September 11, 2023 10:51
ExampleAgent for Genius 7.1.6
@Prasad9
Prasad9 / add_gaussian_noise.py
Last active March 14, 2024 10:28
Python code to add random Gaussian noise on images
import cv2
def add_gaussian_noise(X_imgs):
gaussian_noise_imgs = []
row, col, _ = X_imgs[0].shape
# Gaussian distribution parameters
mean = 0
var = 0.1
sigma = var ** 0.5
@CrisDamian
CrisDamian / aexpansion_example.py
Created May 7, 2018 09:34
Usage example for `aexpansion_grid` from PyMaxflow
import numpy as np
import matplotlib.pyplot as plt
import imageio
from maxflow.fastmin import aexpansion_grid
# Loading image
I = imageio.imread('imageio:astronaut.png')
I = I[:,:,1]/I.max()
@RavinduSachintha
RavinduSachintha / oracle_jdk_install_to_arch.md
Created April 21, 2019 09:15
Description about how to install Oracle JDK8 on Arch Linux OS.

Date : 21 / 04 / 2019

I thought to write this gist due to the difficulties which I had to face when installing Oracle Java Development Kit to my Arch Linux OS. At this moment, AUR links not working for installations because of direct downloads are no longer available. You have to create an Oracle account, download, and put in with the PKGBUILD.

This solution will work with Arch Linux and Manjaro.

Now let's do it.

  1. Its probably easiest to just do it manually instead of trying to dance with an automated helper and its directories.
@onlurking
onlurking / programming-as-theory-building.md
Last active July 22, 2024 13:14
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@jerinphilip
jerinphilip / sample-sbatch-script.sh
Created June 6, 2020 07:35
Sample Sbatch Script
#!/bin/bash
#SBATCH --partition long
#SBATCH --account jerin
#SBATCH --nodes 1
#SBATCH --ntasks 1
#SBATCH --gres gpu:4
#SBATCH --cpus-per-task 40
#SBATCH --mem-per-cpu 2G
#SBATCH --time UNLIMITED
#SBATCH --signal=B:HUP@900
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.