Skip to content

Instantly share code, notes, and snippets.

View slayton's full-sized avatar

Stuart Layton slayton

  • Peterborough NH
View GitHub Profile
@slayton
slayton / consumer_group.py
Created January 22, 2024 19:37
Consumer Group
import asyncio
from faststream import FastStream, Logger
from faststream.redis import RedisBroker, StreamSub
broker = RedisBroker("redis://localhost:6379")
app = FastStream(broker, logger=None)
chan = "chan"
@slayton
slayton / consumer.py
Last active January 22, 2024 19:42
consumer_example.py
import asyncio
from faststream import FastStream, Logger
from faststream.redis import RedisBroker, StreamSub
broker = RedisBroker("redis://localhost:6379")
app = FastStream(broker, logger=None)
chan = "chan"
function onEdit(e) {
var row = e.range.getRow();
var col = e.range.getColumn();
if (col>=2 && col<=13 && row < 3 && e.source.getActiveSheet().getName() === "Temperature") {
e.source.getActiveSheet().getRange(row,14).setValue(new Date());
if (e.source.getActiveSheet().getRange(row,1).getValue() == "") {
e.source.getActiveSheet().getRange(row,1).setValue(new Date());
}

Keybase proof

I hereby claim:

  • I am slayton on github.
  • I am stuartlayton (https://keybase.io/stuartlayton) on keybase.
  • I have a public key whose fingerprint is 1978 A8AD 1E41 AD0D 411F B357 C4E4 6928 013D 26B8

To claim this, I am signing this object:

char *lookUpSpikeTs(int i){
char x[20];
sprintf(x, 'hello world:%d', i);
return x;
}
char *getTsForSpike(int i){
return lookUpSpikeTs(i);
}
@slayton
slayton / check_ip.py
Created October 18, 2012 16:33 — forked from t0mab/check_ip.py
RaspberryPi IP address emailer
#!/usr/bin/python
from subprocess import Popen, PIPE
import smtplib
from socket import gaierror
import string
# This script attepts to retrieve the IP address of a specified interface.
# If successful it then emails the retrieved IP to a specified email address
# FILL OUT THE VALUES BETWEEN THE COMMENT BLOCKS
@slayton
slayton / gist:3640741
Created September 5, 2012 17:33
Simple HTML file that demonstrates Leaflet rendering errors
<html>
<style media="screen" type="text/css"> #map { height: 480px; width:680px; }</style>
<div id="map"></div>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>
<script>