This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Fergus In London - https://fergus.london - <fergus@fergus.london> | |
* | |
* Simple little function for calculating rolling averages, both simple and | |
* weighted. Example can be found on the GitHub Gist, or on my website. | |
* | |
* Do as you please, no rights reserved and no warranties provided. :) | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> // memcpy | |
#include <stdlib.h> // | |
/** | |
* | |
* | |
*/ | |
typedef struct { | |
uint8_t object_count, iteration_counter, max_count; | |
uint8_t *indices_in_use; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fergus In London - https://fergus.london <fergus@fergus.london> | |
# | |
# Uses the org.freedesktop.problems dbus channel to read out reported problems. | |
# | |
# Requires pydbus from pip. | |
# Requires python-gobject and glib installed on your distro. | |
# | |
import sys | |
import argparse | |
from pydbus import SystemBus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple little event registry built around the worlds most simplistic | |
* linked list implementation. Allows you to register a function (void()) | |
* against a integer value, and provides a mechanism for triggering the | |
* associated functions for an integer. | |
* | |
* Not a great deal of use beyond those fun little weekend Arduino type | |
* projects. | |
* | |
* @see example.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Fergus In London - https://fergus.london - <fergus@fergus.london> | |
* | |
* Simple little function for calculating rolling averages, both simple and | |
* weighted. Example can be found on the GitHub Gist, or on my website. | |
* | |
* Do as you please, no rights reserved and no warranties provided. :) | |
*/ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define FIRST_SIX_INDEX (buf[0] & 0xfc) >> 2 | |
#define SECOND_SIX_INDEX ((buf[0] & 0x03) << 4) + ((buf[1] & 0xf0) >> 4) | |
#define THIRD_SIX_INDEX ((buf[1] & 0x0f) << 2) + ((buf[2] & 0xc0) >> 6) | |
#define FOURTH_SIX_INDEX buf[2] & 0x3f | |
char base64_map[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* shuffle(array[]) - Shuffles an array via a simplistic | |
* algo, not too dissimilar to Fisher-Yates. | |
* | |
* Ignore the -ahem- "clever" variable swapping one-liner, | |
* that's all it does. | |
* | |
* @param array | |
* @return array | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am fergusinlondon on github. | |
* I am fergusinlondon (https://keybase.io/fergusinlondon) on keybase. | |
* I have a public key ASAZUkUuHB0BhpbpaL2yBsfar2Rj2ATeaS2RfjJMaiFkpQo | |
To claim this, I am signing this object: |
NewerOlder