Skip to content

Instantly share code, notes, and snippets.

View mfurtak's full-sized avatar

Michael Furtak mfurtak

View GitHub Profile
Make the starter the night before by mixing together with your fingers:
1 cup (4 ¼ ounces) King Arthur Unbleached All-Purpose Flour (or ¾ cup all-purpose flour + ¼ cup whole wheat flour)
3/4 cup (6 ounces) room-temperature water
1 pinch yeast
Cover and let sit at room temperature overnight.
If you need to speed this up, let it sit in the oven with the oven light on for about 6 to 7 hours, and it should be ready to use.
/**
* Designed for use with two 74HC595N shift registers,
* one AT28C64B EEPROM, and an Arduino Micro.
*
* Based on work by Ben Eater from https://www.youtube.com/watch?v=K88pgWhEb1M
*/
// Arduino pins connected to the shift register pins
#define SHIFT_DATA 2
#define SHIFT_CLK 3
String speechMarkup = new SsmlBuilder()
.sentence("Welcome to Fabric!")
.sentence(s -> s.text("To get started, please visit fabric dot").spellOut("IO").text("slash home"))
.sentence("Apps that you mark as favorites will be included in your briefings")
.build();
// speechMarkup gets SSML equivalent to:
//
// <speech>
// <s>Welcome to Fabric!</s>
package com.mikefurtak.speechlet;
import com.amazon.speech.ui.SsmlOutputSpeech;
import com.amazonaws.util.StringInputStream;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
{
"intents": [
{
"intent": "SummaryIntent"
},
{
"intent": "BriefingIntent",
"slots": [
{
"name": "Metric",
@mfurtak
mfurtak / SsmlBuilder.java
Created December 19, 2016 02:29
SSML building
package io.fabric.alexaskills.util;
import java.util.function.Consumer;
public class SsmlBuilder implements SsmlPhrase {
private final StringBuilder stringBuilder;
private boolean built = false;
public SsmlBuilder() {
stringBuilder = new StringBuilder();
@mfurtak
mfurtak / BriefingIntentHandler.java
Last active December 19, 2016 00:46
Literal Alexa custom slot type value handling
switch (metric) {
case "status":
return buildStatusResponse();
case "stability":
return buildStabilityResponse();
case "growth":
return buildGrowthResponse();
case "retention":
return buildRetentionResponse();
default:
@mfurtak
mfurtak / BriefingIntentHandler.java
Last active December 19, 2016 00:54
Painful Alexa custom slot type value handling
switch (metric) {
case "status":
return buildStatusResponse();
case "ability": // Close enough!
case "stability":
return buildStabilityResponse();
case "grove": // Uh, sure.
case "gross": // This is how I feel.
case "growth":
return buildGrowthResponse();
hourPaint = new Paint();
hourPaint.setARGB(255, 200, 200, 200);
hourPaint.setStrokeWidth(6F);
hourPaint.setAntiAlias(true);
hourPaint.setStrokeCap(Paint.Cap.ROUND);
// ...
float hrX = (float) Math.sin(hrRot) * hrLength;
float hrY = (float) -Math.cos(hrRot) * hrLength;
@mfurtak
mfurtak / Android Protips 3.md
Created May 17, 2013 17:16
Notes from the talk, "Android Protips 3" from Google I/O 2013

Android Protips 3

Android Beam

  • Receiver adds intent
  • Can send arbitrary byte data

Lockscreen Widget

  • Specify a different layout for the lockscreen