Skip to content

Instantly share code, notes, and snippets.

View mattwilliamson's full-sized avatar

Matt Williamson mattwilliamson

View GitHub Profile
@mattwilliamson
mattwilliamson / gist:5db7cf94ce2e89459aa25f551b87fc3f
Created June 26, 2023 12:57
Failed jetson-containers build
This file has been truncated, but you can view the full file.
matt@fennee2:~/src$ git clone https://github.com/dusty-nv/jetson-containers
Cloning into 'jetson-containers'...
remote: Enumerating objects: 1394, done.
remote: Counting objects: 100% (542/542), done.
remote: Compressing objects: 100% (219/219), done.
remote: Total 1394 (delta 371), reused 370 (delta 323), pack-reused 852
Receiving objects: 100% (1394/1394), 584.47 KiB | 2.92 MiB/s, done.
Resolving deltas: 100% (920/920), done.
matt@fennee2:~/src$ cd jetson-containers
@mattwilliamson
mattwilliamson / camsense_parser.py
Created April 18, 2023 13:09
camsense x1 lidar parser
import serial
from struct import unpack
import matplotlib.pyplot as plt
import numpy as np
import queue
import threading
from matplotlib.animation import FuncAnimation
import time
import sys
from scipy.ndimage import median_filter, gaussian_filter1d

Keybase proof

I hereby claim:

  • I am mattwilliamson on github.
  • I am aimatt (https://keybase.io/aimatt) on keybase.
  • I have a public key ASBX5bTMl9V_gtr_6q63vxAFqqj3sXOSK2LVNSHWXRUcBAo

To claim this, I am signing this object:

@mattwilliamson
mattwilliamson / sendsqs.js
Created September 6, 2017 14:40
AWS Lambda sample: Send received events to SQS as Message
var QUEUE_URL = 'https://sqs.us-east-1.amazonaws.com/{AWS_ACCUOUNT_}/matsuoy-lambda';
var AWS = require('aws-sdk');
var sqs = new AWS.SQS({region : 'us-east-1'});
exports.handler = function(event, context) {
var params = {
MessageBody: JSON.stringify(event),
QueueUrl: QUEUE_URL
};
sqs.sendMessage(params, function(err,data){
@mattwilliamson
mattwilliamson / rtc_backup.c
Created February 3, 2017 00:51
Squeeze two floats into two uint16_t's
void writeRtcLatLng(void)
{
uint32_t tmp;
// RTC Backup registers have the first 2 bytes reserved. So we get to use the second half of each.
// Write lat tp first two backup registers
tmp = *(uint32_t*)⪫
rtcRegWrite(RTC_BKP_DR6, tmp >> 16);
rtcRegWrite(RTC_BKP_DR7, tmp & 0xffff);
@mattwilliamson
mattwilliamson / echoHttpRequest.js
Last active August 29, 2015 14:08 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);
@mattwilliamson
mattwilliamson / celery_greenlet_traceback.py
Created January 25, 2014 04:11
Celery Greenlet worker death.
[2014-01-24 22:17:36,558: INFO/MainProcess] Task myservice.email.tasks.poll_email_status[cf72ef6d-effa-449e-b866-ee1c3707ce25] succeeded in 2.47090099938s: SM778890846d03dd72f29749f6a7cf517e
[2014-01-24 22:17:36,874: WARNING/MainProcess] Cannot process event on channel 'celeryev': {'pattern': None, 'type': 'message', 'channel': 'celeryev', 'data': '{"body": "eyJ1dGNvZmZzZXQiOiAwLCAidHlwZSI6ICJ0YXNrLXN0YXJ0ZWQiLCAidXVpZCI6ICIyOWVhODQx\nMC02ODk5LTQ1ZTEtYTg3NC1iM2ExOTE1MzRmODgiLCAiY2xvY2siOiA4MTU5NzYsID4+PiBlc3Rh\nbXAiOiAxMzkwNjAwNTE5LjQ5NTMzMywgImhvc3RuYW1lIjogImdyZWVubGV0c0BpbmZsaWdodDMu\nbXlob3N0Lm5ldCIsICJwaWQiOiAzOTYxfQ==", "headers": {"hostname": "greenlets@inflight3.myservice.net"}, "content-type": "application/json", "properties": {"body_encoding": "base64", "delivery_info": {"priority": 0, "routing_key": "task.started", "exchange": "celeryev"}, "delivery_mode'}
Traceback (most recent call last):
File "/www/api.myservice.com/lib/python2.6/site-packages/kombu/transport/redis.py", line 493, in _receive
@mattwilliamson
mattwilliamson / alignment.py
Created December 27, 2013 18:58
Aligning python assignments vertically.
class MyModel(Model):
start_time = DateTimeField()
end_time = DateTimeField()
comment = TextField()
@mattwilliamson
mattwilliamson / webhookr_client.html
Created September 24, 2013 14:37
Webhookr client socket test
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
@mattwilliamson
mattwilliamson / phoneNumberFormatter.js
Created August 14, 2013 22:03
Formats phone numbers to US or E164
function formatNumber(number) {
number = number.replace(/\D+/g, '');
number = number.replace(/^(1)(\d{0,2})$/, '$1($2');
number = number.replace(/^(1)(\d{3})$/, '$1($2)');
number = number.replace(/^(1)(\d{3})(\d{1,3})$/, '$1($2) $3');
number = number.replace(/^(1)(\d{3})(\d{3})(\d{1,4})$/, '$1($2) $3-$4');
number = number.replace(/^(1)(\d{3})(\d{3})(\d{4})(\d+)$/, '$1($2) $3-$4 x$5');
number = number.replace(/^(1)(.*)/, '$1 $2');
return '+' + number;