Skip to content

Instantly share code, notes, and snippets.

@Beherith
Beherith / ParseFastQ.py
Created July 18, 2019 08:39 — forked from xguse/ParseFastQ.py
Simple Python FastQ Parser class
class ParseFastQ(object):
"""Returns a read-by-read fastQ parser analogous to file.readline()"""
def __init__(self,filePath,headerSymbols=['@','+']):
"""Returns a read-by-read fastQ parser analogous to file.readline().
Exmpl: parser.next()
-OR-
Its an iterator so you can do:
for rec in parser:
... do something with rec ...
@Beherith
Beherith / DCC_Timing_tester_esp8266.ino
Created February 25, 2020 15:05
Test the timing of indivisual ones and zeros on the DCC protocol.
#include "ESP8266WiFi.h"
#include "WiFiClient.h"
const int baudrate = 250000;
const int dccpin = 0; //D3 on wemos board
int olddcc = 0;
unsigned long t = 0;
unsigned long lastchangeus = 0;
byte ones[16384];
byte zeros[16384];
@Beherith
Beherith / DCC_Monitor_nano.ino
Created February 26, 2020 14:41
DCC monitor for the arduino nano
#include <DCC_Decoder.h>
# uses library and example from: https://github.com/MynaBay/DCC_Decoder/tree/master/examples/DCC_Monitor
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Defines and structures
//
#define kDCC_INTERRUPT 3 //USES PIN 3 on a nano!
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "Deferred rendering",
version = 3,
desc = "Collects and renders point and beam lights",
author = "beherith, aeonios",
date = "2015 Sept.",
@Beherith
Beherith / gfx_map_lights.lua
Created September 25, 2020 13:22
how to create lights
function widget:GetInfo()
return {
name = "MapLights",
desc = "Adds static lights to maps",
author = "Beherith",
date = "2020",
license = "GNU GPL, v2 or later",
layer = 5,
enabled = false,
}
function widget:GetInfo()
return {
name = "Unitshapes Rendering",
version = "v0.2",
desc = "Unitshapes Rendering",
author = "ivand",
date = "2020",
license = "GPL",
layer = 0,
enabled = false,
@Beherith
Beherith / CUS_GL4.lua
Last active March 10, 2022 15:05 — forked from lhog/CUS_GL4.lua
so incremental works
function widget:GetInfo()
return {
name = "CUS GL4",
author = "ivand",
layer = 0,
enabled = true,
}
end
-- Beheriths notes
@Beherith
Beherith / gfx_unit_outlines_gl4.lua
Last active March 20, 2022 12:50
better outlines
function widget:GetInfo()
return {
name = "Unit Outlines GL4",
desc = "An interesting way of doing unit outlines",
author = "Beherith",
date = "2022.03.05",
license = "Lua: GNU GPL, v2 or later, GLSL code: (c) Beherith, mysterme@gmail.com ",
layer = -50,
enabled = false
}
@Beherith
Beherith / gui_tab_comm_base.lua
Created March 28, 2022 17:48
Mash tab to cycle camera target between your commander and your first factory. Unbinds useless overview mode.
function widget:GetInfo()
return {
name = "Tab Comm Base",
desc = "Binds tab to swap between commander and base",
author = "Beherith",
date = "20220328",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true
}
@Beherith
Beherith / dbg_test_enginecall_perf.lua
Last active May 25, 2023 10:56
test engine call perf
function widget:GetInfo()
return {
name = "Test Engine Call Perf",
desc = "see how long it takes to run large loops of enigne calls",
author = "beherith",
date = "20211114",
license = "GNU GPL, v2 or later",
layer = 10,
enabled = false -- loaded by default?
}