Skip to content

Instantly share code, notes, and snippets.

View nitish6174's full-sized avatar

Nitish Garg nitish6174

View GitHub Profile
@nitish6174
nitish6174 / sublime_packages.md
Last active October 4, 2016 10:38
List of useful Sublime text packages
  • Manager and explorer :
    • Package manager : To manage all your sublime packages
    • SideBarEnhancements : Gives an extensive menu for renaming, duplicating file etc from the file explorer pane (The left column)
  • Themes & Color schemes :
    • Monokai Extended
    • Predawn
    • Theme - Afterglow
    • Theme - Asphalt
    • Theme - Brogrammer
  • Theme - Flatland
@nitish6174
nitish6174 / ubuntu-gnome-extensions.md
Created October 4, 2016 19:29
List of useful Ubuntu Gnome extensions to install
  • Alternatetab (Ungroup windows of same type)
  • Applications menu (Windows OS style Applications menu)
  • Caffeine (Disable autosuspend)
  • Clipboard indicator (Clipboard history)
  • Drop down terminal (Alternative to Guake terminal)
  • Easyscreencast (Screen recording)
  • Laine (Control volume of each application)
  • Media keys (Music control buttons on topbar)
  • Media player indicator (Music controller for topbar)
  • Pixel saver (Brings title bar applications to topbar)
@nitish6174
nitish6174 / ubuntu-gnome-themes.md
Last active October 4, 2016 19:36
List of dark themes for Ubuntu Gnome
  • Adapta
  • Arc
  • Flatabulous
  • Nebula
  • Numix
  • Paper
  • Super flat remix (Icon theme)
@nitish6174
nitish6174 / server_setup.md
Last active November 1, 2016 08:44
Commands to setup development tools on an Ubuntu server
sudo apt-get update
sudo apt-get upgrade
# --------------------------------------------------
# Basic programs
# --------------------------------------------------
sudo apt-get install openssh-server
sudo apt-get install vim
sudo apt-get install git
sudo apt-get install curl
@nitish6174
nitish6174 / bashrc
Last active June 12, 2017 01:02
Bash aliases for the lazy typers
## Add sudo wherever needed
## list all files in current directory
alias ll="ls -alh"
## apt shorthands
alias sau="sudo apt-get update"
alias sai="sudo apt-get install"
sar() {
sudo apt-get autoremove
@nitish6174
nitish6174 / mouse_cursor_using_keyboard.md
Last active October 6, 2018 19:12
Settings to control mouse cursor using keyboard
  1. Open 'Settings' -> 'Universal Access' -> 'Pointing and clicking' -> 'Mouse keys'
  2. Turn that option ON
  3. Now you will be able to move cursor with numpad but the speed will be extremely slow.
  4. Run the following commands in terminal to set a good to do speed :
    sudo apt-get install xkbset
    xkbset ma 60 10 10 5 2

PyInstrument

from pyinstrument import Profiler
profiler = Profiler()

profiler.start()

# --- code to profile : start ---
# e.g. :-
from crontab import CronTab
from datetime import datetime
cron = CronTab()
cmds = {
'python ~/code/reminder.py': '0/30 9-18 * * *',
'~/code/backup.sh': '0/30 9-18 * * *',
}
for cmd, cron_str in cmds.items():

Remove trailing whitespace from files

sed -i 's/[ \t]*$//' folder/*/*.py

Convert Jupyter notebook to PPT

# General use-case
jupyter nbconvert --to slides filename.ipynb
# Code-free conversion
"""
Module containing utility functions to time code snippets.
"""
import contextlib
import time
@contextlib.contextmanager
def timelogger(msg_prefix:str='Executed in : ', msg_suffix:str='s', logger=print):