Skip to content

Instantly share code, notes, and snippets.

View danieljfarrell's full-sized avatar

Daniel danieljfarrell

View GitHub Profile
@danieljfarrell
danieljfarrell / vernemq_grafana_dashboard.json
Last active March 27, 2024 15:29
VerneMQ Grafana dashboard configuration. This works with a VerneMQ, docker swarm cluster and swarmprom
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@danieljfarrell
danieljfarrell / example.pyx
Created February 12, 2021 13:52
Cython example showing numpy to C struct
#cython: language_level=3
import cython
import numpy
cimport numpy as cnumpy
# Silly example C struct
cdef struct example:
@danieljfarrell
danieljfarrell / cython_c_struct_idioms.pxd
Created February 26, 2021 18:28
Idioms for handling C struct in Cython
# Idiom - C struct container simple values
#
# Idiom - Use ctypedef so we can can pass this
# easily in and out of functions.
#
cdef struct book:
int uid
ctypedef book book_t
@danieljfarrell
danieljfarrell / code_blocks2.vbp
Last active May 25, 2021 10:45
VB code block for controlling Ronald Dekker's uTracer copt-paste from here (to have nice syntax highlighting) https://www.dos4ever.com/uTracer3/code_blocks2.txt
Note that:
dblCalVar1 = Va Gain
dblCalVar2 = Vs Gain
dblCalVar3 = Ia Gain
dblCalVar4 = Is Gain
dblCalVar5 = Vsupp
dblCalVar6 = Vgrid(40V)
dblCalVar7 = VglowA
dblCalVar8 = Vgrid(4V)
@danieljfarrell
danieljfarrell / tree_scroll.py
Created September 14, 2021 15:18
TraitsUI tree editor example
from traits.api import HasTraits, Str, List, Button, Any
from traitsui.api import TreeNode, TreeEditor, View, ModelView, Group, VGroup, Item
from pkg_resources import resource_filename
tree_icon_path = resource_filename("traitsui", "wx/images")
class Measurement(HasTraits):
name = Str("Measurement")