Skip to content

Instantly share code, notes, and snippets.

View bombela's full-sized avatar

François-Xavier Bourlet bombela

View GitHub Profile
@bombela
bombela / avr_delay.rs
Last active June 9, 2022 08:31
Produce the minimal number of machine instructions to delay by the exact number of cycles on AVR with Rust using inline assembly and associated const.
// Copyright 2022 François-Xavier Bourlet <[email protected]>
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
rofi usage:
rofi [-options ...]
Command line only options:
-no-config Do not load configuration, use default values.
-v,-version Print the version number and exit.
-dmenu Start in dmenu mode.
-display [string] X server to contact.
${DISPLAY}
-h,-help This help message.
@bombela
bombela / stress_client.py
Created August 6, 2012 18:59
stress PyZMQ to trigger the 'missing event' problem
#!/usr/bin/env python
import zerorpc.gevent_zmq as zmq
context = zmq.Context()
c = zmq.Socket(context, zmq.XREQ)
c.connect('tcp://127.0.0.1:9998')
print 'running'
class Speaker
{
public:
struct Scope
{
Scope(bool verbose = false) { resetCounters(); setVerbose(verbose); }
~Scope() { printStats(); }
};
~Speaker() { speak() << "destructor" << std::endl; ++_counters.dtor; }