Skip to content

Instantly share code, notes, and snippets.

View posborne's full-sized avatar

Paul Osborne posborne

View GitHub Profile
@posborne
posborne / SimpleAvControl.lua
Created August 29, 2023 03:25
Generated Simple AV Controller Command Class Code for SmartThings Edge
-- Copyright 2023 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
@posborne
posborne / keybase.md
Created March 15, 2016 02:19
keybase.md

Keybase proof

I hereby claim:

  • I am posborne on github.
  • I am posborne (https://keybase.io/posborne) on keybase.
  • I have a public key ASCUOV5r83dMKJAKG6TMqC3sfw9JnlXAHmAQUMBtJMpfewo

To claim this, I am signing this object:

@posborne
posborne / ptymaster.c
Created October 30, 2013 01:38
Example showing a simple usage of PTY without use of fork()
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
/*
* Simple Echo Server that repeats back characters, with a spin
*/
@posborne
posborne / moneytimer.html
Created January 11, 2013 14:43
Timer to track how much time and money is being wasted in meetings
<html>
<head>
<title>Timer</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js"></script>
<script type="text/javascript">
var stdt = null;
var running = false;
var TICKS_PER_SEC = 1000;
padn = function(d, l) {
ds = "" + d;
from pacman.fields import UBInt16, VariableRawPayload, LengthField, Magic, \
UBInt8Sequence, DispatchField, DispatchTarget, UBInt8, UBInt32, BitField, BitNum, \
BitBool
from pacman.message import BaseMessage
import unittest
class UDPFrame(BaseMessage):
source_port = UBInt16()
destination_port = UBInt16()
@posborne
posborne / countpaths.py
Created February 13, 2012 01:44
Count paths through a directed acyclic graph (and display graph)
#!/usr/bin/env python
"""Build a graph, count the paths and visualize (using graphviz)
Under ubuntu 11.10, the following steps should allow you to run
this script (assuming working from virtualenv)::
$ pip install python-graph-core python-graph-dot
$ sudo apt-get install graphviz libgv-python
"""
@posborne
posborne / countpaths.py
Created February 13, 2012 01:32
Counts path in graph and display
#!/usr/bin/env python
"""Build a graph, count the paths and visualize (using graphviz)
Under ubuntu 11.10, the following steps should allow you to run
this script (assuming working from virtualenv)::
$ pip install python-graph-core python-graph-dot
$ sudo apt-get install graphviz libgv-python
"""
@posborne
posborne / getattr_test.py
Created December 31, 2011 00:52
Strange failure with getattr
from compiler import visitor as compvisitor
import compiler
import sys
class VisitorChecker(compvisitor.ASTVisitor):
"""
AST Visitor that pulls together individual AST checkers
The VisitorChecker takes in other Visitor classes and delegates
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
why = getattr(selectable, method)()
File "/usr/lib/python2.6/dist-packages/twisted/internet/tcp.py", line 667, in doConnect
self._connectDone()
File "/usr/lib/python2.6/dist-packages/twisted/internet/tcp.py", line 674, in _connectDone
self.protocol.makeConnection(self)
File "/usr/lib/python2.6/dist-packages/twisted/internet/protocol.py", line 349, in makeConnection
self.connectionMade()
File "/usr/lib/python2.6/dist-packages/twisted/web/client.py", line 60, in connectionMade
@posborne
posborne / Example Output
Last active September 1, 2015 17:23
Zinc Debug ELF Files
✘ ⚙  (env)  posborne@povm  ~/Projects/rust-playground/zinc/examples/empty   pwm-support-squashed ●  arm-none-eabi-size -A -d target/thumbv7m-none-eabi/debug/empty pwm-support-squashed [afd7fb0] modified untracked
target/thumbv7m-none-eabi/debug/empty :
section size addr
.data 0 268435456
.vector 204 0
.debug_gdb_scripts 34 204
.text 1164 240
.bss 8 268435456
.ARM.attributes 45 0
.debug_str 966614 0