Skip to content

Instantly share code, notes, and snippets.

View aarohmankad's full-sized avatar
🎯
Focusing

Aaroh Mankad aarohmankad

🎯
Focusing
View GitHub Profile
vector<pair<int, int>> getThem() {
vector<pair<int, int>> v;
for (pair<int, int> x : theList) {
if (x.second == 4) {
v.push(x);
}
}
return v;
@aarohmankad
aarohmankad / bad_names.cpp
Created December 6, 2017 01:42
An example of bad naming conventions
vector<pair<int, int>> getThem() {
vector<pair<int, int>> v;
for (pair<int, int> x : theList) {
if (x.second == 4) {
v.push(x);
}
}
return v;
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'pangloss/vim-javascript'
Plugin 'mattn/emmet-vim'
# make directory and change working directory to it
function mcd {
if [ $# -ne 1 ]; then
echo "Usage: mcd <directory-name>"
return
fi
mkdir $1
cd $1
}
# Miscellaneous aliases
alias ..='cd ..'
alias x='exit'
alias d='rm -rf'
alias math='insect'
alias chsh='chmod 711 *.sh'
# Filesystem aliases
alias mkdir='mkdir -pv'
alias top='htop'
@aarohmankad
aarohmankad / .bashrc
Last active January 25, 2018 06:13
Bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# Run tmux by default
if command -v tmux>/dev/null; then
[[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux
fi
# If not running interactively, don't do anything
for (element of document.querySelectorAll('.bt-request-buffed')) { element.click() }
double ackermann(double m, double n) {
if (m == 0) {
return n + 1;
} else if (n == 0) {
return ackermann(m - 1, 1);
}
return ackermann(m - 1, ackermann(m, n - 1));
}
export default {
baseUrl: 'http://hackuci.herokuapp.com/api',
}
@aarohmankad
aarohmankad / custom_style.css
Created December 9, 2016 23:35
Add color-coded commenting to Hacker News
tr.comtr td table tr td.ind img[src="s.gif"][width="0"] {
border-right: 2px solid purple;
height: 100%;
padding-left: 5px;
}
tr.comtr td table tr td.ind img[src="s.gif"][width="120"] {
border-right: 2px solid yellow;
height: 100%;
padding-left: 5px;