Skip to content

Instantly share code, notes, and snippets.


Allen McPherson mcpherson

View GitHub Profile
mcpherson /
Created Mar 27, 2016
Test static pointer to instance member (for use in callback function)
// Test static pointer to object member from callbacks
// g++ -std=c++11 -g -O3 -o statmem
#include <iostream>
class Test;
static Test *bug;
class Test {
mcpherson /
Created Mar 21, 2016
Two methods for setting nested messages in protobuf
#include "butt.pb.h"
#include <string>
#include <iostream>
int main(int argc, char ** argv)
// Args: option 1: long string of pointers
butt::Args args;
args.set_k(99); // k
View plot.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
mcpherson / gist:2917a7fddc1d9ec725b2
Created Oct 7, 2014
Reset GitHub repo URLs between HTTPS and SSH
View gist:2917a7fddc1d9ec725b2
git config remote.origin.url{USERNAME}/{REPONAME}.git
git config remote.origin.url https://{USERNAME}:{PASSWORD}{USERNAME}/{REPONAME}.git
git config remote.origin.url https://{USERNAME}{USERNAME}/{REPONAME}.git
Sourced from
You can’t perform that action at this time.