cat facts
url: https://cat-fact.herokuapp.com/facts
code:
<div style="border: 1px solid black;padding: 5px;">
<h3 style="padding:0;margin:0">CAT FACTS</h3>
{% for fact in data %}
{{ fact.text }}<br />
// npm install; npm start | |
const http = require('http'), | |
faye = require('faye'); | |
const server = http.createServer(), | |
bayeux = new faye.NodeAdapter({mount: '/signal', timeout: 45}); | |
bayeux.attach(server); | |
server.listen(8080); |
url: https://cat-fact.herokuapp.com/facts
code:
<div style="border: 1px solid black;padding: 5px;">
<h3 style="padding:0;margin:0">CAT FACTS</h3>
{% for fact in data %}
{{ fact.text }}<br />
pieces you asked about:
// translate the 24 bit color from RGB to the actual
// order used by the LED wiring. GRB is the most common.
int colorWiring(int c) {
int red = (c & 0xFF0000) >> 16;
int green = (c & 0x00FF00) >> 8;
int blue = (c & 0x0000FF);
red = gammatable[red];
#!/usr/bin/env ruby | |
# | |
# Demo of the "severe typing lag" layout bug we found. | |
# | |
# Things that fix the lag: | |
# - set textarea width to a non-percentage value | |
# - set .container grid-template-rows: to anything other than `auto`, e.g., | |
# `100vh` or `100%` work; or remove the property | |
# - set .container height: to a fixed value or remove the property |
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Fontawesome 5! Get it here: https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself --> | |
<link rel="stylesheet" href="css/all.min.css" /> | |
<style> | |
body { | |
background: rgba(0, 0, 0); | |
color: #ffffff; | |
font-size: 16px; |
#!/usr/bin/env python | |
# based on https://github.com/adafruit/io-client-python/blob/master/examples/mqtt_client.py | |
import io | |
import time | |
import os | |
# Camera setup guide: https://learn.adafruit.com/cloud-cam-connected-raspberry-pi-security-camera/pi-camera-setup | |
import picamera | |
import base64 |
<!doctype html> | |
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.js"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.css" /> | |
<style> | |
body { | |
margin: 0; padding: 0; |
#!/usr/bin/env python | |
""" | |
Download all data from a list of Adafruit IO feeds. Change constants in this | |
file in the CONFIGURATION section before you run the script. | |
Usage: | |
$ START="2019-05-01T00:00Z" END="2019-06-01T00:00Z" \ | |
python download_paged_data.py | |
""" |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.min.js"></script> | |
<script src="support.js"></script> | |
<script src="sketch.js"></script> |
/* | |
Publish from an ESP8266 to a generic TCP server. | |
This sketch uses the simplest protocol possible | |
to send numbers over the wire. | |
*/ | |
#include <ESP8266WiFi.h> |