https://blog.pother.ca/StackOverflow/ Code and Examples to accompany my answers and questions on the StackOverflow website.
HTML PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_layouts
question.13808020.include-an-svg-hosted-on-github-in-markdown
question.15191811.forcing-orthogonal-vertical-or-horizontal-edges-with-dot
question.16067272.in-php-get-entire-word-from-mysql-search-result-using-like
question.16080373.php-regex-to-check-if-image-is-wrapped-with-a-tag
question.19319383.objects-attributes-in-graphviz
question.19502559.graphviz-legend-key-with-nodes
question.7023138.make-panel-img-fit-on-all-screens
question.9251556.problems-with-designing-uml-like-diagrams-in-graphviz
.gitignore
_config.yml
readme.md

readme.md

permalink
/

StackOverflow

Code and examples to go with my answers and questions on the stackoverflow website.

Currently I have several answers where I use code examples. In some cases a live version is profided using jsfiddle or ideone, etc, but I thought it might be a good idea to have all of this information together in one place as well.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="https://rawgithub.com/chjj/marked/master/lib/marked.js"></script> <script> /* var sUrl = 'readme.md'; // @TODO: The location.hash needs to be checked to see if another file has been asked for. $.get(sUrl, function(p_sResult) { var sHtml; // Clicks on any link to local/relative markdown files need to be // caught and handled through AJAX, also the location.hash should be // updated to reflect this. sHtml = marked(p_sResult); $('.container').html(sHtml); }); */ addMenu(); // For this specific purpose things could be taken even further than this... // // Any code block that use PHP could be caught and posted to the IDEone // API and the result could be added to the page. Or we could run the // script locally, save the output, commit that to the repo and use that // to display with the answer... // // For graphviz examples we could also use http://oodavid.com/gviz/ /* Retrieve a list of available answers */ function addMenu() { function foo(p_sCallback) { $.getJSON('https://api.github.com/repos/potherca-blog/StackOverflow/git/refs/heads' , function(p_oResponse, p_sStatus, p_oXHR) { $.getJSON('https://api.github.com/repos/potherca-blog/StackOverflow/git/trees/' + p_oResponse[0].object.sha , function(p_oResponse, p_sStatus, p_oXHR) { $.each(p_oResponse.tree, function(p_i, p_oTree){ if(p_oTree.type === 'tree') { p_sCallback(p_oTree.path); } }); } ); } ); } $('.container').append($('

Available Answers

')); var $List = $('.container').append($('
    ')); foo(function(p_sPath){ if (p_sPath.indexOf('question.') === 0) { var sContent = '
  • ' + p_sPath+ '<\/a><\/li>' $List.append(sContent); } }); }; </script>