Skip to content

Instantly share code, notes, and snippets.

View TG9541's full-sized avatar

Thomas TG9541

View GitHub Profile
@DavidBruchmann
DavidBruchmann / combining_composer_git_pear.md
Last active October 13, 2023 17:58
Combining Composer, Git repositories and Pear

Combining composer, git repositories and pear

Problem

Pear is the the old PHP-packagemanager, but most 'packages' are nowadays managed with composer on base of git-repositories.
Adding pear-packages to a composer based installation is a little challenge that shall be explained below.

Solution

Prerequisites

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 4 09:16:27 2021
@author: mark
"""
import serial
from numpy.random import randint
\ ADC single scan mode 1 channel at a time
\res MCU: STM8L051
\res export CLK_PCKENR2 ADC1_CR1 ADC1_CR2 ADC1_CR3
\res export RI_ASCR1 RI_IOSR2
\res export ADC1_SQR1 ADC1_SQR2 ADC1_SQR3 ADC1_SQR4
\res export ADC1_DRH ADC1_DRL
\res export ADC1_SR
#require ]B!
@rohitfarmer
rohitfarmer / nvimr-demo.md
Last active January 31, 2024 05:32
Nvim-R Demo

How to use Neovim or VIM Editor as an IDE for R

Note: This tutorial is written for Linux based systems.

Requirements

R >= 3.0.0

To install the latest version of R please flollow the download and install instructions at https://cloud.r-project.org/

Neovim >= 0.2.0

Neovim (nvim) is the continuation and extension of Vim editor with the aim to keep the good parts of Vim and add more features. In this tutorial I will be using Neovim (nvim), however, most of the steps are equally applicable to Vim also. Please follow download and installation instructions on nvim's GitHub wiki https://github.com/neovim/neovim/wiki/Installing-Neovim.

import telnetlib
import time
def read_header(tn):
tn.read_until("\n", 1)
def twos_complement(input_value):
return (~input_value +1) & 0xFF
def mbascii_request(payload):
@bademux
bademux / dch2ihx.py
Last active February 15, 2019 15:03
Converts uCsim dumps to ihx format
#!/usr/bin/env python2.7
# Converts uCsim dumps to ihx format https://en.wikipedia.org/wiki/Intel_HEX
# 'dch 0xXX 0xXX 16' dumps ROM to multiple rows formated like {adress} {byte 1} ... {byte 16} {ASCI_representation}
import argparse
import sys
NUMBER_OF_BYTES = 16
def parse_arguments():
@kianby
kianby / zproxy.py
Last active November 25, 2023 07:28
ZeroMQ, Python, XSUB / XPUB proxy
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import zmq
def main():
context = zmq.Context()
@timcardenuto
timcardenuto / redhawk-raspberry-pi.md
Last active September 10, 2022 14:56
How to build Redhawk for Raspberry Pi, Raspbian Stretch, using QEMU

Redhawk on Raspberry Pi

One option for compiling Redhawk for the Raspberry Pi is using QEMU on a host to compile it into the image before loading on the rpi hardware - this takes advantage of the superior hardware on your host to decrease compile time. These instructions verified for host system Ubuntu 16.04, Raspberry Pi image Raspbian Stretch 2017-09-07, and Redhawk 2.0.7.

It is important to note that Redhawk is only officially supported on CentOS 6 and 7 and therefore any time you try to compile it for other OS's it's possible (likely on systems like Ubuntu/Debian) that you'll have issues with newer versions of dependencies, the most likely offenders in the past have been:

Library CentOS 6.9 CentOS 7.4 Ubuntu 16.04 Debian 9.2 Raspbian Stretch Fedora 28
gcc 4.4.7 4.8.5 5.4.0 6.3.0 6.3.0 8.1.1
libstdc++ 4.4.7 4.8.5 5.4.0 6.3.0 6.3.0 8.1.1
@tdavchev
tdavchev / Markov Random Field Image de-noising
Created November 21, 2016 23:13
Simple Python implementation of the Markov Random Field (MRF) Image de-noising illustration from Bishop's Pattern Recognition and Machine Learning Book, Chapter 8
from scipy import misc
import numpy as np
import random
from pylab import *
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
im = misc.imread('lena512.bmp')
im = np.asarray(im)
@motine
motine / README.md
Last active October 12, 2021 03:35
Redis Pub/Sub with Python (notes for my collegue)

Redis Pub/Sub with Python

Overview:

  • Redis supports PUB/SUB
  • It supports pattern matching. Clients may subscribe to glob-style patterns in order to receive all the messages sent to channel names matching a given pattern.

Prerequisites

Assuming Fedora 23.