Skip to content

Instantly share code, notes, and snippets.

Allen McPherson mcpherson

Block or report user

Report or block mcpherson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mcpherson
mcpherson / gist:2917a7fddc1d9ec725b2
Created Oct 7, 2014
Reset GitHub repo URLs between HTTPS and SSH
View gist:2917a7fddc1d9ec725b2
git config remote.origin.url git@github.com/{USERNAME}/{REPONAME}.git
git config remote.origin.url https://{USERNAME}:{PASSWORD}@github.com/{USERNAME}/{REPONAME}.git
git config remote.origin.url https://{USERNAME}@github.com/{USERNAME}/{REPONAME}.git
Sourced from http://superuser.com/questions/199507/how-do-i-ensure-git-doesnt-ask-me-for-my-github-username-and-password
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
mcpherson / butt.cc
Created Mar 21, 2016
Two methods for setting nested messages in protobuf
View butt.cc
#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
@mcpherson
mcpherson / statmem.cc
Created Mar 27, 2016
Test static pointer to instance member (for use in callback function)
View statmem.cc
// Test static pointer to object member from callbacks
// g++ -std=c++11 -g -O3 statmem.cc -o statmem
#include <iostream>
class Test;
static Test *bug;
class Test {
public:
You can’t perform that action at this time.