Skip to content

Instantly share code, notes, and snippets.

Avatar

Allen McPherson mcpherson

View GitHub Profile
@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:
@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
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 / 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
You can’t perform that action at this time.