Skip to content

Instantly share code, notes, and snippets.

Avatar

Bryan Hanson bryanhanson

View GitHub Profile
View ExploreGithubTopics.Rmd
---
title: "Explore Github Topics"
author: "Bryan Hanson"
date: 2020-01-24
---
<!-- Following code to keep printed version cleaner; see https://stackoverflow.com/a/24467913/633251 -->
<style type="text/css" media="print">
a:link:after, a:visited:after {
content: normal !important;
@bryanhanson
bryanhanson / GithubAccess.R
Last active Jan 25, 2020
Set up Github authorization on your local machine
View GithubAccess.R
# R code
# Based on https://stackoverflow.com/a/23810363/633251
# This is called "Web Application Flow"
# see https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow
# Follow the instructions there to set up a token. Never share your key or secret.
library("httr")
myapp <- oauth_app("FOSS", key = "pqr", secret = "xyz")
github_token <- oauth2.0_token(oauth_endpoints("github"), myapp)
@bryanhanson
bryanhanson / d3simpleLine1.html
Created Nov 14, 2014
A simple d3 Line example
View d3simpleLine1.html
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src = "http://d3js.org/d3.v3.min.js"> </script>
</body>
<script>
@bryanhanson
bryanhanson / reallySimpleD3line.html
Created Apr 27, 2014
Drawing a line in d3.js starting from separate x & y arrays
View reallySimpleD3line.html
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src = "http://d3js.org/d3.v3.min.js"> </script>
<script>
// Draw a very simple line using d3 functions
@bryanhanson
bryanhanson / IntersectLineSeg.R
Created Apr 26, 2013
Determine if two line segments intersect (not lines!)
View IntersectLineSeg.R
# R functions to determine if two line segments intersect
# Note: this is very different question from whether
# two lines intersect (terminology is important!)
# These functions are based upon the excellent discussion here,
# written by Martin Thoma:
# martin-thoma.com/how-to-check-if-two-line-segments-intersect/
# The starting point was the code here:
# github.com/MartinThoma/algorithms/tree/master/crossingLineCheck/Geometry/src