Skip to content

Instantly share code, notes, and snippets.

import altair as alt
from vega_datasets import data
source = alt.topo_feature(data.world_110m.url, "countries")
osm_url, otm_url = ('https://tile.openstreetmap.org/', 'https://tile.opentopomap.org/')
select_urls = alt.binding_select(options=[osm_url, otm_url], name='select tile service')
param_urls = alt.param(bind=select_urls, value=osm_url)
param_tx = alt.param(expr="width / 2")
param_ty = alt.param(expr="height / 2")
param_base_tile_size = alt.param(value=256)

How to get firmware onto mutable modules

I had the best luck with the Black Magic Probe and gdb.

Install compiler

First install the arm compiler:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
@willb
willb / expenv.sh
Created December 2, 2019 19:48 — forked from sophwats/expenv.sh
#!/bin/sh
while getopts ":if:" opt; do
case $opt in
f)
useFile=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
## temporary installing Strimzi
oc apply -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.8.2/strimzi-cluster-operator-0.8.2.yaml
# Simple Cluster with one ZK and one Kafka node
oc apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/master/examples/kafka/kafka-persistent-single.yaml

oc get pods -n myproject -w 

wait...

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@willb
willb / appText.py
Created September 30, 2016 19:38
k-means microbenchmark with text-file input
import argparse
from time import clock
from pyspark.sql import SparkSession
from pyspark.mllib.clustering import KMeans
from numpy import fromstring
parser = argparse.ArgumentParser()
parser.add_argument('--master', help='Spark master URL (default: "local[*]")', default="local[*]")
@willb
willb / explanation.md
Created September 14, 2016 21:29 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

// 'small' was a subsample of meta-full parquet
scala> small.orderBy(small("@timestamp")).map(utils.toJSON).saveAsTextFile("/home/eje/logdemo/logs_ordered.json")
@willb
willb / schema.md
Created May 20, 2016 02:30
yikes!
root
 |-- acl: string (nullable = true)
 |-- acl_action: string (nullable = true)
 |-- acl_status: string (nullable = true)
 |-- action: string (nullable = true)
 |-- after: string (nullable = true)
 |-- agent: string (nullable = true)
 |-- arch: string (nullable = true)
 |-- assignee: struct (nullable = true)

| |-- gravatar_id: string (nullable = true)

@willb
willb / README.md
Created September 10, 2014 14:23
How to allow Twitter or emailed feedback from Octopress posts

post.html goes in source/_layouts/post.html and feedback.html goes in source/_includes/post/feedback.html