Skip to content

Instantly share code, notes, and snippets.

View prof7bit's full-sized avatar

Bernd K. prof7bit

  • Hannover, Germany
View GitHub Profile
@prof7bit
prof7bit / .gitignore
Last active March 17, 2022 09:13
The portfolio rebalancing bot will buy and sell to maintain a constant asset allocation ratio of exactly 50/50 = fiat/BTC
/.project
@prof7bit
prof7bit / benchmark-and-plot.py
Last active March 29, 2021 18:05
test app and benchmarking for wsgi/asgi servers
from subprocess import check_output
import matplotlib
import matplotlib.pyplot as plt
from time import sleep
TITLE = 'gunicorn/gevent 50ms'
SERVER = 'localhost'
PORT = 8888
@prof7bit
prof7bit / psk31.c
Created January 10, 2015 20:49
psk31 demodulation on ATMega328 without any multiplikation
/*
* psk31.c
*
* Created on: 09.01.2015
* Author: bernd
*/
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
@prof7bit
prof7bit / lazinstall.py
Last active September 11, 2018 06:47
Install fpc 3.0-fixes and Lazarus 1.6-fixes on Debian completely from Source
#!/usr/bin/python3
import os
LAZDIR = os.path.expanduser("~/lazsvn")
print(LAZDIR)
exit
def shell(cmd):
if os.system(cmd) != 0:
@prof7bit
prof7bit / phase_error.ipynb
Created October 15, 2017 17:23
phase_error
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prof7bit
prof7bit / _stoploss.py
Created April 22, 2013 18:01
A simple stop loss bot. Adjust STOP_PRICE and STOP_VOLUME to your needs. The file can be reloaded after editing without restarting goxtool by simply pressing the l key.
"""
a simple stop loss bot.
adjust STOP_PRICE and STOP_VOLUME to your needs.
The file can be reloaded after editing without
restarting goxtool by simply pressing the l key.
"""
import strategy
import goxapi
# pylint: disable=C0301
@prof7bit
prof7bit / geiger.py
Created July 13, 2013 15:28
Geiger counter for MtGox. This goxtool strategy module adds sound effects to goxtool.py. It makes a click sound for every depth message and a louder click for every trade.
"""
Geiger counter for MtGox.
This goxtool strategy module makes a click sound for every
depth message and a louder click for every trade.
You must have python-alsaaudio installed to use this.
usage:
save file as "geiger.py" in the goxtool folder and then:
procedure TBuddy.OnProxyConnect(ASocket: TLSocket);
type
TSocksReqestHeader = packed record
Typ : Byte;
Cmd : Byte;
Port : Word;
Addr4 : DWord;
end;
var
ReqHeader: TSocksReqestHeader;
@prof7bit
prof7bit / gist:2967955
Created June 21, 2012 19:27
how is this supposed to work in 3.0.0, my private file descriptors are none of Pidgin's business!
/**
* Starts a file transfer.
*
* Either @a fd must be specified <i>or</i> @a ip and @a port on a
* file receive transfer. On send, @a fd must be specified, and
* @a ip and @a port are ignored.
*
* Prior to libpurple 2.6.0, passing '0' to @a fd was special-cased to
* allow the protocol plugin to facilitate the file transfer itself. As of
* 2.6.0, this is supported (for backward compatibility), but will be
{ This function is not what it seems to be. It will NOT simply be called
with the filename already known (as one might assume when looking
at its signature) instead it will be called with filename=nil when
the user clicks on the "Send File..." menu item. At this time there
has not yet been a file dialog to select the file, this will happen
when we call purple_xfer_request(). All the rest is then done from
within the callbacks that we are registering here. }
procedure torchat_send_file(gc: PPurpleConnection; who, filename: PChar); cdecl;
var
xfer: PPurpleXfer;