Skip to content

Instantly share code, notes, and snippets.

@stonehippo
stonehippo / webkit_scrolling_ltr_rtl.html
Created June 30, 2015 13:23
Testing WebKit native scrolling with LTR and RTL content
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style media="screen">
body {
font-size: 2em;
}
@stonehippo
stonehippo / 1_barebones.ino
Last active August 29, 2015 14:24
Spark: Intro to Arduino
void setup() {
// This code is run once, each time the Arduino is powered on or reset
}
void loop() {
// This code is run repeatedly, as fast as the Arduino can run it
}
/*
* Cantina Entryway Interactive Diorama
*
* The diorama currently consists of two motor-driven elements, a pair of rotating
* arms. This sketch manages the movement of those arms.
*
* Each arm is attached to a DC gearmotor, which are driven via a SN745510 Dual
* H-bridge. This IC allows for reversing the motors.
*
* Copyright (C) 2015 Cantina. All rights reserved.
@stonehippo
stonehippo / crockford_object_creation_pattern.js
Last active October 24, 2019 12:30
Douglas Crockford's preferred Javascript object constructor pattern, from https://www.youtube.com/watch?v=bo36MrBfTk4 (starting at 35:45)
// The pattern Crockford uses these days.
function constructor(spec) {
var that = other_constructor(spec),
member,
method = function () {
// spec, member, method
}
that.method = method;
return that;
}
@stonehippo
stonehippo / imageDownScaler.js
Created August 17, 2015 15:56
A snippet to scale down an image in-browser
/*
Takes a file object, assumed to be an image, and scales it to fit within
a maximum width and height.
Returns the resulting scaled image as a dataURL.
*/
function imageDownScaler(file, callback, maxWidth, maxHeight) {
var scaleDimensionsIfNeeded = function(w, h, maxW, maxH) {
@stonehippo
stonehippo / map_overlay_knockout.html
Last active July 8, 2019 10:47
Creating a Canvas overlay on a Google Map and knocking out some holes in that overlay
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Canvas Demo Knockout</title>
<style>
body {
font-family: sans-serif;
color: #555;
}
@stonehippo
stonehippo / IoT_hardware_platforms.md
Last active March 19, 2021 02:03
A compendium of data and communications platforms for the Internet of Things, MQTT, and other connected stuff

some hardware platforms I find interesting

  • Raspberry Pi - popular Linux SBCs, and now some really cool microcontrollers
  • MESH — drop-in DIY IoT components
  • Particle — Connected prototyping for wifi and cell-based products
  • Hologram — similar to Particle
  • Electric Imp — Connected device platform, with modules and services; part of Twilio now
  • Intel Edison — Tiny x86-class board dead and buried
  • C.H.I.P — $9 computing platform seems to be gone now
  • bluz — BLE boards, compatible with Particle Cloud
@stonehippo
stonehippo / elixir-web-frameworks.md
Last active September 13, 2015 19:21
Elixir: a list of Web frameworks

Elixir Web Frameworks

I'm learning Elixir. As usual, it's easier to learng a new language when there's some way to apply it. Building for the web is a decent application.

I'm collecting this list of Elixir Web frameworks for reference. Caveat: I haven't used these frameworks much or at all.

@stonehippo
stonehippo / nodeMCU_esp8266_resources.md
Last active May 5, 2020 03:36
nodeMCU & ESP8266 resources

nodeMCU & ESP8266 resources

There are several ways to create firmware for the esp8266 serial wifi boards, including firmware written with Espressif SDK, Arduino, MicroPython and nodeMCU. nodeMCU is firmware that embeds a lua-based interpreter on the esp8266. This lets you write scripts directly on the device via the serial console, or saves scripts to be executed at boot.

Resources

  • The nodeMCU API — the complete API available on-device
  • esp8266 posts by Big Dan the Blogging Man — useful, real world stuff. Includes notes on how to set up the init.lua on an esp8266 so that in can be interrupted (a really useful thing when we don't want to have to reflash the board if something goes wrong with the startup script).
  • [Learn.Adafruit esp8266 posts](https://learn.adafruit.com/search?q=esp8266
@stonehippo
stonehippo / init.lua
Last active September 14, 2015 20:49
Tankbot esp8266 controller
-- startup logic
dofile("wifi.lua")
dofile("server.lua")