Skip to content

Instantly share code, notes, and snippets.

import PlaygroundSupport
import SwiftUI
extension UIView {
var renderedImage: UIImage {
let image = UIGraphicsImageRenderer(size: self.bounds.size).image { context in
UIColor.lightGray.set(); UIRectFill(bounds)
context.cgContext.setAlpha(0.75)
self.layer.render(in: context.cgContext)
}
return image
@alexbbrown
alexbbrown / .block
Last active October 10, 2016 09:04
Pokemon Guess Who
license:gpl-2.0;
height:800px;
@alexbbrown
alexbbrown / _.md
Created January 3, 2013 05:15
two simple but different axes
@alexbbrown
alexbbrown / USArrests.csv
Created December 31, 2012 22:57
More complex table from multiply nested data
State Crime Count
Alabama Murder 13.2
Alaska Murder 10
Arizona Murder 8.1
Arkansas Murder 8.8
California Murder 9
Colorado Murder 7.9
Connecticut Murder 3.3
Delaware Murder 5.9
Florida Murder 15.4
@alexbbrown
alexbbrown / USArrests.csv
Created December 31, 2012 22:21
More complex table from nested data
Alabama Murder 13.2
Alaska Murder 10
Arizona Murder 8.1
Arkansas Murder 8.8
California Murder 9
Colorado Murder 7.9
Connecticut Murder 3.3
Delaware Murder 5.9
Florida Murder 15.4
@alexbbrown
alexbbrown / USArrests.csv
Created December 31, 2012 22:19
Simple table from nested data
Alabama Murder 13.2
Alaska Murder 10
Arizona Murder 8.1
Arkansas Murder 8.8
California Murder 9
Colorado Murder 7.9
Connecticut Murder 3.3
Delaware Murder 5.9
Florida Murder 15.4
@alexbbrown
alexbbrown / USArrests.csv
Created December 31, 2012 22:18
Simple table from nested data
Alabama Murder 13.2
Alaska Murder 10
Arizona Murder 8.1
Arkansas Murder 8.8
California Murder 9
Colorado Murder 7.9
Connecticut Murder 3.3
Delaware Murder 5.9
Florida Murder 15.4
@alexbbrown
alexbbrown / d3widget.js
Last active October 18, 2016 20:58 — forked from anonymous/d3widget.js
Simple Shiny Example of Javascript Input and Output
<script src="http://d3js.org/d3.v3.js"></script>
<script type="text/javascript">
(function(){
// Probably not idiomatic javascript.
this.countValue=0;
updateView = function(message) {
var svg = d3.select(".d3io").select("svg")