Skip to content

Instantly share code, notes, and snippets.

@tabrez
tabrez / .aliases
Last active October 28, 2022 10:28
alias gst='git status'
alias gco='git checkout'
alias ga='git add'
alias gd='git diff'
alias gc='git commit'
alias gp='git push'
alias gl='git pull'
alias gs='git stash'
# make these commands work predictably in all environments
@tabrez
tabrez / .bashrc
Last active October 29, 2022 05:57
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# Control bash history
# http://www.biostat.jhsph.edu/~afisher/ComputingClub/webfiles/KasperHansenPres/IntermediateUnix.pdf
# https://unix.stackexchange.com/questions/48713/how-can-i-remove-duplicates-in-my-bash-history-preserving-order
# don't put duplicate lines or lines starting with space in the history.
@tabrez
tabrez / install_ansible.sh
Created April 18, 2022 15:59
Install Ansible on Ubuntu from PPA
export DEBIAN_FRONTEND=noninteractive
apt-get update -y
apt-get install -y acl sudo software-properties-common python-is-python3
apt-add-repository -y ppa:ansible/ansible
apt-get install -y ansible
@tabrez
tabrez / .vimrc
Last active August 5, 2023 04:08
minimal vim config
"
" A (not so) minimal vimrc.
"
" You want Vim, not vi. When Vim finds a vimrc, 'nocompatible' is set anyway.
" We set it explicitely to make our position clear!
set nocompatible
filetype plugin indent on " Load plugins according to detected filetype.
@tabrez
tabrez / gitconfig
Created April 8, 2022 07:07
Minimal git configuration
[user]
name = "Tabrez Iqbal"
email = "tabrez@mailbox.org"
[color]
ui = true
[color "branch"]
current = green bold
local = yellow bold
remote = green bold
@tabrez
tabrez / zshrc
Last active April 12, 2022 17:04
Minimal zsh configuration
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
export TERM="xterm-256color"
fpath+=~/.zsh/pure
autoload -U promptinit; promptinit
autoload -U compinit; compinit
prompt pure
@tabrez
tabrez / rush-eslint.md
Created January 29, 2022 16:35
Microsoft Rush + ESLint + VS Code Setup

Microsoft Rush + ESLint + VS Code Setup

Use the following code in .eslintrc.js in node/backend projects:

// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch/modern-module-resolution')

module.exports = {
  extends: [

Basic configuration

sudo apt-get install gnome-tweak-tool

Displays -> Scaling 200%
OR Tweaks -> Fonts -> Scaling 2.0

Tweaks -> Top bar -> Clock -> Date
Date & Time -> AM/PM & Auto timezone

const { GraphQLServer } = require('graphql-yoga');
const server = new GraphQLServer({ typeDefs, resolvers });
server.start(() => console.log('Server is running...'));
// run integration tests
// how to stop the server?
"""Implement doubly-linked list in Python."""
class Node:
"""Node implementation for doubly-linked list."""
def __init__(self, v=None, next=None, prev=None):
"""Construct a node."""
self.value = v
self.next = next