Skip to content

Instantly share code, notes, and snippets.

@tabrez
tabrez / install_ansible.sh
Created Apr 18, 2022
Install Ansible on Ubuntu from PPA
View install_ansible.sh
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 Apr 14, 2022
minimal vim config
View vimrc
"
" 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
execute pathogen#infect()
filetype plugin indent on " Load plugins according to detected filetype.
@tabrez
tabrez / zshrc
Last active Apr 12, 2022
Minimal zsh configuration
View zshrc
# 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 / gitconfig
Created Apr 8, 2022
Minimal git configuration
View gitconfig
[user]
name = "Tabrez Iqbal"
email = "tabrez@mailbox.org"
[color]
ui = true
[color "branch"]
current = green bold
local = yellow bold
remote = green bold
@tabrez
tabrez / rush-eslint.md
Created Jan 29, 2022
Microsoft Rush + ESLint + VS Code Setup
View rush-eslint.md

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: [
@tabrez
tabrez / basic_statistics.ipynb
Last active Jul 30, 2020
basic_statistics.ipynb
View basic_statistics.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View basic_linux_setup.md

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

View graphql-yoga-stop.js
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?
View doubly_linked_list.py
"""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
View linked_list.py
"""Linked List implementation in Python."""
class LinkedCell:
"""Node implementation for linked list."""
def __init__(self, v, n=-1):
"""Construct for LinkedCell."""
self.value = v
self.next = n