Skip to content

Instantly share code, notes, and snippets.

View scottcame's full-sized avatar

Scott Came scottcame

  • data.world
  • Olympia, Washington, USA
  • X @scottcame
View GitHub Profile
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAEZ0FNQQAAsY58+1GTAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAIABJREFUeNrtfQeTJdd53Xk55zAzb3Kenc2LBbDIoBhFUjKpYLssWZbtcvkn2VaVSyq7yqYkixbNJJIiEQiQXGBznt2dnGdezvn5fnd2FhsmvNDdr9/MPaguALsvdfftc794Pk02m6tBQEBAoAOgFZdAQEBAEJaAgICAICwBAQFBWAICAgIqh36vP7RYzOLKCAgItBW5XF5YWAICAsIlFBAQEBCEJSAgICAIS0BAQBCWgICAgCAsAQGBYw+92n5QtVbD4+UtlMrlL1hVo4Fer4Nep2X/NqJcraJYqqJWU38bJPvpHEGPHR67KBcREDhShPXJjUf47M7cnn9nNRsxFPKjL+iF3mDEo7Uolrbi6ADegob986fvnUS31y5WnYDAUXAJU5k8rt5f2Pfvs/ki7s2t4fO7cwjHYpgIuXFhPASLUa/6C11j/9yc3RArTkDgqBDWZUZElUr10NfFUllGWgu4N7sCK+OqN6b7EHTbVH+x16NpseIEBI4KYT1YWK/fYmF+4PxaGFfuLSCTyeL8aBfsFqOqL3YqW0CpXBWrTkDgKBCWxWRo+D2JdBa3H68gm8uhy63u+BC5hZ2QKBAQEIRVB7786vTTrFojiDMXcT2cQMjvaOr9SkHDfpzRoBOrTkDgKBAWZQD7u7xNvXdpPQKTXoten1O1F9vrsIgVJyDQAlSXXvMxt25pI9rw+9K5Ata3YxgNeXksK1csw6DTIprKIZbOqaL0YbDLLVacgMBRIqx0Nt/0e+/OruAVox49Hit3v2rs6A84sRJO4dFqpL3uIPtn
@scottcame
scottcame / vp-chart
Created December 28, 2020 05:08
Volume Profile Chart Example
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"height": 800,
"width": 800,
"layer": [
{
"layer": [
{
"mark": {
"type": "bar",
var rl = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('Please enter a number: ', value => {
if (!(/[\-0-9]+/.test(value))) {
console.log("That's not a number. I said enter a number.")
process.exit(1);
}
import java.util.Scanner;
public final class NumberLab3 {
public static void main(String[] args) {
System.out.print("Enter a number: ");
String value = new Scanner(System.in).next();
if (!value.matches("[\\-0-9]+")) {
import java.util.Scanner;
public final class NumberLab2 {
public static void main(String[] args) {
System.out.print("Enter a number: ");
Scanner s = new Scanner(System.in);
String value = s.next();
int odds = 0;
int evens = 0;
import java.util.Scanner;
public final class NumberLab {
public static void main(String[] args) {
System.out.print("Enter a number: ");
Scanner s = new Scanner(System.in);
String value = s.next();
int odds = 0;
int evens = 0;
@scottcame
scottcame / washington-municipalities.R
Last active May 2, 2019 17:17
washington-municipalities
library(tidyverse)
library(sf)
wa_counties <- read_sf('/opt/data/Shapefiles/cb_2017_us_county_500k/cb_2017_us_county_500k.shp') %>% filter(STATEFP=='53')
wa_places <- read_sf('/opt/data/Shapefiles/cb_2017_53_place_500k/cb_2017_53_place_500k.shp')
ggplot() +
geom_sf(data=wa_counties %>% filter(NAME=='Thurston')) +
geom_sf(data=wa_places %>% filter(LSAD %in% c('25','43')) %>%
st_intersection(wa_counties %>% filter(NAME=='Thurston')), aes(fill=NAME)) +
@scottcame
scottcame / spec.js
Created July 31, 2018 16:20
Platform benchmark timeline example
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"description": "Stock prices of 5 Tech Companies over Time.",
"data": {
"values":[
{
"date": "2018-01-01",
"bm": "Maytown PD",
"value": 0.88
},
@scottcame
scottcame / spec.js
Last active July 17, 2018 16:34
Vega Lite Color Scale issue
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"config": {
"invalidValues": null
},
"autosize": {
"type": "fit",
"contains": "padding"
},
"encoding": {
@scottcame
scottcame / Dockerfile
Created June 29, 2018 16:25
Keras Install Fail 20180629
FROM rocker/r-ver:3.5.0
RUN apt-get update && apt-get install -y libcurl4-openssl-dev libssl-dev libssh2-1-dev curl python3-pip zlib1g-dev && \
pip3 install --upgrade pip && \
pip install virtualenv && \
R -e 'install.packages("devtools")' && \
apt autoremove -y
RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl')" >> /usr/local/lib/R/etc/Rprofile.site && \
# R -e 'devtools::install_github("rstudio/reticulate")' && \