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" .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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]): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# License: GPL | |
# Copyright: Miheer Vaidya ([email protected]) | |
import sys | |
import re | |
def getSpillOffsets(f) -> set: | |
""" | |
Given file `f' returns set of offsets of spill locations | |
""" | |
pattern = re.compile(r".* (-?\d+\(%rsp\)).*") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://blogs.technet.microsoft.com/heyscriptingguy/2007/02/03/hey-scripting-guy-how-can-i-use-windows-powershell-to-get-a-list-of-all-the-open-windows-on-a-computer/ | |
# https://stackoverflow.com/questions/4993926/maximize-window-and-bring-it-in-front-with-powershell | |
# Needs Powershell community extentions | |
Set-ForegroundWindow (get-process Spotify | Where-Object {$_.MainWindowTitle -ne ""}).MainWindowHandle |