Skip to content

Instantly share code, notes, and snippets.

View playgroundRender.swift
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 Oct 10, 2016
Pokemon Guess Who
View .block
license:gpl-2.0;
height:800px;
@alexbbrown
alexbbrown / USArrests.csv
Created Dec 31, 2012
More complex table from multiply nested data
View USArrests.csv
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 Dec 31, 2012
More complex table from nested data
View USArrests.csv
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 Dec 31, 2012
Simple table from nested data
View USArrests.csv
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 Dec 31, 2012
Simple table from nested data
View USArrests.csv
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 Oct 18, 2016 — forked from anonymous/d3widget.js
Simple Shiny Example of Javascript Input and Output
View d3widget.js
<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")