Skip to content

Instantly share code, notes, and snippets.

View vmiheer's full-sized avatar

miheer vaidya vmiheer

View GitHub Profile
@vmiheer
vmiheer / pinOutputToCsv.py
Created March 25, 2019 21:55
Convert pin output to csv
"""
Pin output to csv
"""
import sys
import re
import argparse
startOfDynamicSection = False
outFile = open(sys.argv[2], 'w')
for line in open(sys.argv[1]):
@vmiheer
vmiheer / EmacsConfig.md
Created May 16, 2019 17:57
emacs configurations

install ycmd

installing rtags

CC=gcc CXX=g++ cmake --debug-trycompile -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
  -DLIBCLANG_CXXFLAGS="-I~/.emacs.d/ycmd/cpp/llvm/include \
  -Wl,-rpath,~/.emacs.d/ycmd/clang_archives/lib/libclang.so" \
  -DLIBCLANG_LIBDIR="~/.emacs.d/ycmd/clang_archives/lib" .
I've tested it on Fedora 23 and Ubuntu 16.04. I'm using gcc-5.3.1, python-3.4, VS Code-1.14.0
You can debug mixed Python/C++ in the same GUI. It also works for MPI applications. You can switch between the debuggers and corresponding call stacks.
1. Packages needed
1) Visual Studio Code
2) Extensions for VS Code:
"Python" from Don Jayamanne (I'm using 0.6.7)
This allows VS Code act as the front end to debug python.
This gives VS Code ability to attach to a python script that uses module "ptvsd".
@vmiheer
vmiheer / hey_notmuch!
Created June 24, 2020 21:02 — forked from vedang/hey_notmuch!
Notmuch configuration for Hey.com Style workflows.
- Specific Notmuch filters (and saved-searches) for:
+ The Feed (newsletters, blogs)
+ The Paper trail (receipts, ledger)
+ Screened Inbox (mail from folks you actually want to read)
+ Previously Seen (important mail that you've already read)
+ Unscreened Inbox (potential spam / stuff you don't want)
- Elisp Functions to move / categorize emails from a particular sender.
+ Adds tags needed by filters defined above to all email sent by a particular sender
+ Creates an entry in a DB file, which is used by the Notmuch post-new script when indexing new email, to auto-add the relevant tags.
@vmiheer
vmiheer / GetBeBOP.cmake
Created August 28, 2020 22:07
Cmake for BeBOP Sparse Matrix Converter
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
ExternalProject_Add(bebop_make
URL http://bebop.cs.berkeley.edu/smc/tarballs/bebop_make.tar.gz
SOURCE_DIR bebop/bebop_make
CONFIGURE_COMMAND cmake -E cmake_echo_color --red --bold "Don't skip configuration step if on non-linux platform see ${CMAKE_CURRENT_BINARY_DIR}/bebop/bebop_make/README!"
BUILD_COMMAND cmake -E echo "Skipping build step."
INSTALL_COMMAND cmake -E echo "Skipping install step."
)
ExternalProject_Get_property(bebop_make SOURCE_DIR)
# fix clang compilation database in the cases where one compiler uses another host compiler
# e.g. nvcc/icc using gcc headers
from subprocess import Popen, PIPE
from typing import List
import re, json
startRe = re.compile(r"#include [\"<][.]{3}[\">] search starts here:")
endRe = re.compile(r"^End of search list.$")
def getDefaultIncludes():
p1 = Popen(["echo", ""], stdout=PIPE)
function LoadLib(urls) {
var url;
for (url of urls) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url
document.head.appendChild(script)
}
}
@vmiheer
vmiheer / zshinit.sh
Last active October 29, 2020 22:02
My zsh setup
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
cp ~/.zshrc ~/.zshrc.back.mv
# https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# https://github.com/zsh-users/zsh-completions
git clone --depth=1 https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
sed -r -i 's/^plugins=.*/plugins=(git fasd virtualenvwrapper zsh-autosuggestions per-directory-history zsh-completions)/g' ~/.zshrc
source ~/.zshrc
@vmiheer
vmiheer / venv_cheat_sheet.md
Last active November 10, 2020 07:32 — forked from bbengfort/venv_cheat_sheet.md
My virtualenv and virtualenv wrapper cheat sheet. I alias the commands of virtualenv and virtualenv wrapper for my own development environment.

Ben's VirtualEnv Cheatsheet

This cheat sheet describes my usage/implementation of virtualenv with virtualenv wrapper and the bash foo that I added with the help of many blogs to make it all tick together in fun land.

Quick Reference

$ echo $WORKON_HOME
/Users/benjamin/.virtualenvs

$ echo $PROJECT_HOME
@vmiheer
vmiheer / privateFork.sh
Last active November 16, 2020 21:58
Create github private fork
function private_clone() {
sourceRepo=$2
destOrg=$1
repoName=$(echo $sourceRepo | cut -d/ -f 2)
destRepo=$(echo $destOrg/$repoName)
gh repo create -y --private $destRepo
git clone --bare [email protected]:$sourceRepo\.git
cd $repoName\.git
git push --mirror [email protected]:$destRepo
cd ..; rm -rf $repoName\.git;