Skip to content

Instantly share code, notes, and snippets.

View gonium's full-sized avatar

Mathias Dalheimer gonium

View GitHub Profile
@gonium
gonium / guilloches.m
Created November 14, 2017 12:19
An octave script to create guilloches
function points = guilloches(Theta, R, r, p)
points = [];
for theta = Theta,
x = (R+r)*cos(theta) + (r+p)*cos(((R+r)/r)*theta);
y = (R+r)*sin(theta) + (r+p)*sin(((R+r)/r)*theta);
points = [ points; x, y ];
end
end
@gonium
gonium / gist:9790686
Created March 26, 2014 18:56
keybase.md
### Keybase proof
I hereby claim:
* I am gonium on github.
* I am gonium (https://keybase.io/gonium) on keybase.
* I have a public key whose fingerprint is E7BA B68E A2D3 9B6A ECEF 4DE4 823E 0DBE B650 1625
To claim this, I am signing this object:
memset(&switchmsg, 0, sizeof(switchmsg));
strncpy(switchmsg.type, "HEXABUS", sizeof(switchmsg.type));
switchmsg.source = 1;
if (strcmp(argv[2], "on") == 0) {
printf("sending ON command\r\n");
switchmsg.command=htons(ON);
}
static void
udphandler(process_event_t ev, process_data_t data)
{
char buf[UDP_DATA_LEN];
struct hexabusmsg_t *hexabuscmd;
if (ev == tcpip_event) {
if(uip_newdata()) {
PRINTF("udp_handler: received '%d' bytes from ", uip_datalen());
PRINT6ADDR(&UDP_IP_BUF->srcipaddr);
hexabuscmd = (struct hexabusmsg_t *)uip_appdata;
@gonium
gonium / gist:1127251
Created August 5, 2011 10:03
Process startup
PROCESS_THREAD(udp_handler_process, ev, data) {
uip_ipaddr_t ipaddr;
PROCESS_POLLHANDLER(pollhandler());
PROCESS_EXITHANDLER(exithandler());
// see: http://senstools.gforge.inria.fr/doku.php?id=contiki:examples
PROCESS_BEGIN();
PRINTF("udp_handler: process startup.\r\n");
// wait 3 second, in order to have the IP addresses well configured
etimer_set(&udp_periodic_timer, CLOCK_CONF_SECOND*3);