Skip to content

Instantly share code, notes, and snippets.

View johnwheeler's full-sized avatar
🏠
Working from home

John Wheeler johnwheeler

🏠
Working from home
  • San Diego, California
View GitHub Profile

Flask-Ask Live Presentation Over the Web

The creator of Flask-Ask will show your group of 3 or more how easy it is to program the Amazon Echo with Python!

You ask 'Alexa' to play songs, get the weather, and report scores. Those 'skills', as they're called, have an open API for building conversational apps. That API is the Alexa Skills Kit, and Flask-Ask is a Python framework that makes working with it easy.

Developing with Flask-Ask is fun. It's a novel experience to write and test conversational code,

@johnwheeler
johnwheeler / distance to point
Created December 28, 2015 17:37
distance to point
func distanceToPoint(point p: CGPoint, fromLineSegmentBetween l1: CGPoint, and l2: CGPoint) -> Float {
let a = p.x - l1.x
let b = p.y - l1.y
let c = l2.x - l1.x
let d = l2.y - l1.y
let dot = a * c + b * d
let lenSq = c * c + d * d
let param = dot / lenSq
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
config.vm.network "private_network", ip: "192.168.0.100"
config.vm.provider "virtualbox" do |vb|
vb.memory = "8192"
end
var SRC_JS = 'client/js/**/*.js';
var SRC_LESS = 'client/less/**/styles.less';
var SRC_HTML = '*.html';
var DEST_STYLES = 'static/styles/';
var DEST_SCRIPTS = 'static/scripts/';
var PROXY = 'localhost:8000';
var gulp = require('gulp');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
{
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.light.tmTheme",
"detect_indentation": false,
"folder_exclude_patterns":
[
".webassets-cache",
".git",
"out"
],
"font_size": 14,
@johnwheeler
johnwheeler / logstash_formatter.py
Last active July 11, 2017 11:52
Python Logstash Formatter compatible with json codec format
import logging
import json
class LogstashFormatter(logging.Formatter):
def __init__(self, fmt=None, datefmt='%Y-%m-%dT%H:%M:%SZ'):
super(LogstashFormatter, self).__init__(fmt, datefmt)
def format(self, record):
obj = record.__dict__.copy()