Skip to content

Instantly share code, notes, and snippets.

@bhavyangupta
bhavyangupta / .anaconda_with_ros_wrapper.bash
Created September 17, 2018 23:09 — forked from StefanFabian/.anaconda_with_ros_wrapper.bash
Bash script to use Anaconda with ROS
### This script wraps all executables in the anaconda bin folder so that they can be used without adding Anaconda
### to the path which would break some functionality of ROS (Robot Operating System)
###
### The commands e.g. jupyter notebook will cause the script to add anaconda to the path, start jupyter notebook
### and after jupyter notebook terminated remove anaconda from the path again
###
### Notable commands:
### * release-the-snake Adds conda to the path and removes all aliases defined by this script
### Conda will stay in the PATH until the end of the session (terminal is closed) or
### until "cage-the-snake" is called
@bhavyangupta
bhavyangupta / curl.md
Created July 13, 2017 11:01 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@bhavyangupta
bhavyangupta / GitHub curl.sh
Created July 13, 2017 10:47
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@bhavyangupta
bhavyangupta / enum_to_str.cpp
Created October 9, 2016 04:45
Enumerator values to string
#include <iostream>
#define str(x) #x
enum State {
One,
Two
};
int main() {
std::cout << str(One) << std::endl;