Skip to content

Instantly share code, notes, and snippets.

@userx14
userx14 / sysxToBin.py
Last active September 14, 2025 12:15
Circuit tracks firmware reverse engineering
import numpy as np
from pathlib import Path
import crcmod
import sys
def extract_sysex_messages(syx_path):
commands_list = dict([
(0x71, "UPDATE_INIT"),
(0x72, "UPDATE_WRITE"),
(0x73, "UPDATE_FINISH"),
@userx14
userx14 / midiFeedback.ino
Last active August 20, 2025 05:11
Novation Circuit Tracks chromatic sample playback with MIDI.
#include <MIDI.h>
#define MidiInChannel 3 //default setting of MIDI 1 out channel for circuit tracks
#define MidiDrumChannel 10 //drum 1 channel, other drums on 61,62,63
#define MidiDrumNote 60 //drum 1 channel, other drums on 61,62,63
#define pitchRelativeTo 60 //sample is unpitched for c4 = midi note 60
const float twelfthRootOfTwo = 1.0594631; //frequency ratio between adjacent semitones
@bjoern-r
bjoern-r / Huawei_E3372_openwrt.md
Last active August 30, 2025 13:02
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update
import django_filters
class CommaSeparatedValueFilter(django_filters.CharFilter):
"""Accept comma separated string as value and convert it to list.
It's useful for __in lookups.
"""
def filter(self, qs, value):
@Karmak23
Karmak23 / drf-no-none.py
Last active March 10, 2023 04:47
django-rest-framework Model Serializer base class to exclude None/null values from output.
class WithoutNoneFieldsSerializer(serializers.ModelSerializer):
""" Exclude model fields which are ``None``.
This eventually includes foreign keys and other special fields.
Source: https://gist.github.com/Karmak23/5a40beb1e18da7a61cfc
"""
def to_native(self, obj):
@Karmak23
Karmak23 / drf_logger.py
Last active November 29, 2020 00:53
Django Rest Framework logger mixin
class DRFLoggerMixin(object):
"""
Allows us to log any incoming request and to know what's in it.
Usage:
class MyOwnViewSet(DRFLoggerMixin,
mixins.ListModelMixin,
viewsets.GenericViewSet):
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active February 25, 2025 22:09
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
"""Here's how you implement Foo(pkid) with postgres.orm 2.1.x.
Discovered at PyTennesse with @wlphoenix @PederSchacht et al.
"""
class Foo(Model):
typname = 'foo'
def __new__(cls, pkid_or_record):
@aaugustin
aaugustin / HOWTO.md
Last active December 3, 2019 20:18
Connecting a Django application to a Microsoft SQL Server database from Debian GNU/Linux
  1. Install and register the FreeTDS driver for unixODBC.

     apt-get install tdsodbc
     odbcinst -i -d -f /usr/share/tdsodbc/odbcinst.ini
    
  2. (Optional) Test the DSN-less connection with pyodbc.

     apt-get install python-pyodbc
    

>>> import pyodbc

@namuol
namuol / INSTALL.md
Last active December 11, 2024 12:21
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.