Skip to content

Instantly share code, notes, and snippets.

import { html, css, LitElement } from 'lit-element';
import * as d3 from "d3";
export class DayThree extends LitElement {
static get styles() {
return css`
:host {
display: block;
padding: 25px;
__increment() {
if (this.counter < 20) {
this.counter += 1;
d3.select(this.shadowRoot.getElementById('target')).style("stroke-width", this.counter)
}
}
__decrement() {
if (this.counter > 0) {
this.counter -= 1;
render() {
return html`
<h1>${this.title}</h1>
<svg>
<circle id="target" style="fill: #69b3a2; stroke-width: ${this.counter}" stroke="black" cx=50 cy=50 r=40></circle>
</svg>
<button ?disabled=${this.counter == 20} @click=${this.__increment}>increment</button>
<button ?disabled=${this.counter == 0} @click=${this.__decrement}>decrement</button>
<h1>${this.counter}</h1>
`;
__decrement() {
if (this.counter > 0) {
this.counter -= 1;
d3.select(this.shadowRoot.getElementById('target')).style("stroke-width", this.counter)
}
}
render() {
return html`
<h1>${this.title}</h1>
@samsends
samsends / keybase.md
Created November 16, 2018 04:23
keybase.md

Keybase proof

I hereby claim:

  • I am sbsends on github.
  • I am sbsends (https://keybase.io/sbsends) on keybase.
  • I have a public key ASBlnsm9bwLSHYIGe8XDC-JscYvuvlyKVo_o3bYqBL7iPAo

To claim this, I am signing this object:

@samsends
samsends / Dockerfile
Last active August 6, 2018 02:02
Example protoc image for compiling protocol buffers. Full guide: https://medium.com/p/a9db25ca529a
FROM golang:1.10
RUN apt-get update && apt-get -y install unzip && apt-get clean
# install protobuf
ENV PB_VER 3.6.1
ENV PB_URL https://github.com/google/protobuf/releases/download/v${PB_VER}/protoc-${PB_VER}-linux-x86_64.zip
RUN mkdir -p /tmp/protoc && \
curl -L ${PB_URL} > /tmp/protoc/protoc.zip && \
cd /tmp/protoc && \
@samsends
samsends / build.yaml
Last active August 6, 2018 01:32
Example Cloud Build Configuration for compiling protocol buffers. Full guide: https://medium.com/p/a9db25ca529a
# Decrypt the file containing the key!
# --ciphertext-file= is the path to your encrypted SSH key.
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args:
- kms
- decrypt
- --ciphertext-file=.cloudbuild/id_rsa.enc
- --plaintext-file=/root/.ssh/id_rsa
- --location=global