Skip to content

Instantly share code, notes, and snippets.

View JuliaGizmos-Introduction.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ansarid /
Created Aug 1, 2019
mjpg_streamer opencv module
sudo apt update
sudo apt install mjpg-streamer-opencv-python

Create filter file. (/home/debian/

import cv2
import numpy as np
View Makefile
obj-m += uio_pruss_shmem.o
make -C /lib/modules/`uname -r`/build M=`pwd` V=1 ARCH=arm modules
make -C /lib/modules/`uname -r`/build INSTALL_MOD_PATH=/lib/modules/`uname -r` M=`pwd` V=1 ARCH=arm modules_install
cd /lib/modules/`uname -r`
depmod -a
pranav083 / GPIO_p8_11_led3.p
Created Jun 11, 2019
gpio not working p8.11
View GPIO_p8_11_led3.p
.origin 0
.entrypoint START
// the number of times we blink the LED
#define GPIO_BANK1 0x4804c000
#define GPIO1_LED3BIT 1<<24
#define GPIO_SETDATAOUT 0x194
pwntr / EAGLE.desktop
Created Feb 11, 2019
Proper EAGLE PCB E-CAD desktop launcher for Ubuntu/GNOME
View EAGLE.desktop
# copy this file to ~/.local/share/applications/. Change installation paths below to fit your setup.
[Desktop Entry]
Comment=PCB design: schematic capture, board layout, and autorouter
# paths need to be absolute, no ~ allowed within this file
JasonLS / 7segment.c
Created Aug 28, 2018
C code to use baconbits two 7 segment displays
View 7segment.c
#include <stdio.h>
#include <unistd.h>
int main() {
FILE * spidev = fopen("/dev/spidev2.1", "wb");
//Left 7 Segment
fwrite("\x40\x00\xc0", 1, 3, spidev);//"0's" are on, "1's" are off
//Right 7 Segment
fwrite("\x40\x01\xc0", 1, 3, spidev);
//You should see the segments look like zeroes.
pdp7 / BB-SPIDEV1-00A0.dts
Last active Feb 25, 2018
src/arm/BB-SPIDEV1-00A0.dts modify to add tinydrm st7735r for Adafruit 1.8" TFT LCD connected to BeagleBone Black running 4.16.0-rc2-bone3 kernel. More info:
View BB-SPIDEV1-00A0.dts
* Copyright (C) 2013 CircuitCo
* Virtual cape for SPI1 on connector pins P9.29 P9.31 P9.30 P9.28
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
View grove-probe
#!/usr/bin/env perl
my $devices = `i2cdetect -y -r 2`;
#print $devices;
my @lines = split /\n/, $devices;
foreach my $line ( @lines ) {
next if $line =~ /^\s/; # skip lines starting with whitespace
$line =~ s/\d\d\:\s*//; # remove 2 digit indexes
#print $line , "\n";
my @entries = split /\s/, $line;
foreach my $entry ( @entries ) {
walchko /
Last active Aug 17, 2021
a better mjpeg streamer in python using opencv 3.x
#!/usr/bin/env python3
# MIT License
# (c) 2017 Kevin J. Walchko
# Updated 16 Mar 2020: Python 3.7.5 Ubuntu 19.10
# Desktop, wired interface is enp2s0
# Raspberry Pi: wlan0
# Ideally, this should be fixed, it is hard coded right now
ravikp7 / output
Created Jun 4, 2017
Schemapack encoding doesn't work for array of more than 9 objects.
View output
ravi@ravi-Lenovo-G50-45:~/beagle-js$ node serializer-test.js
var ref1=json;var ref2=ref1['a'];var ref3=ref2[0];var ref4=ref2[1];var ref5=ref2[10];var ref6=ref2[2];var ref7=ref2[3];var ref8=re
f2[4];var ref9=ref2[5];var ref10=ref2[6];var ref11=ref2[7];var ref12=ref2[8];var byteC=0;byteC+=1;byteC+=1;byteC+=bag.dynamicByteC
ength);for (var j2=10;j2<ref2.length;j2++) { var ref13xn=ref2[j2];byteC+=1;}var wBuffer=bag.allocUnsafe(byteC);bag.byteOffset=0;if
(typeof(ref3['a']) !== 'number'||ref3['a']<0||ref3['a']>255){bag.throwTypeError(ref3['a'],'number',0,255,'uint8');}bag.byteOffset
= wBuffer.writeUInt8(ref3['a'], bag.byteOffset, true);if (typeof(ref4['b']) !== 'number'||ref4['b']<0||ref4['b']>255){bag.throwTy
peError(ref4['b'],'number',0,255,'uint8');}bag.byteOffset = wBuffer.writeUInt8(ref4['b'], bag.byteOffset, true);if (typeof(ref5['p
ad']) !== 'string'){bag.throwTypeE