Skip to content

Instantly share code, notes, and snippets.

@todbot
todbot / circuitpyton_disable_usb_boot.py
Last active August 27, 2023 10:11
Disable USB devices in CircuitPython in boot.py
# circuitpython_disable_usb_boot.py
# Turn on/off certain USB features based on touching RX & TX pins
# Squeeze TX & RX pins with fingers to enable CIRCUITPY & REPL
# Otherwise, they are turned off
# CircuitPython 7.x only
# Rename this as "boot.py" in your CIRCUITPY drive on a QT PY
# @todbot 17 May 2021
import time
import board
@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active December 6, 2023 20:42
How to notarize a Unity build for MacOs 10.15 Catalina

How to notarize a Unity build for macOs 10.15 Catalina

As of January 2020, all apps running on macOs 10.15 Catalina are required to be notarized. For Unity games distributed outside the Mac App Store, such as with Steam, the notarization process is done post build using a series of Xcode command line tools.

Prerequisites

  • a Mac that is compatible with macOs 10.15 Catalina :
    • MacBook (2015 or newer)
    • MacBook Air (2012 or newer)
  • MacBook Pro (2012 or newer)
@ideoforms
ideoforms / sox-cheat-sheet.sh
Last active June 6, 2024 05:14
sox cheat sheet
################################################################################
# sox cheat sheet
################################################################################
# Example commands for the sox command-line audio processing tool,
# for manipulating or batch processing audio files.
################################################################################
# Daniel Jones <dan-web@erase.net>
################################################################################
################################################################################
@peterhellberg
peterhellberg / paint16b.asm
Created November 21, 2018 16:42
MS-DOS paint program in 16 bytes found at http://www.sizecoding.org/wiki/Paint16b
org 100h ; code starts at 0x100
mov al,0x12 ; assume ah = 0 ; set graphics mode to 640*480
inc bx ; assume bx = 0 ; set to 1 (show cursor)
mloop:
int 0x10 ; first loop, switch to graphic mode
; further loops, set pixel
xchg bx,ax ; first loop, set AX to 1 (show cursor)
; further loops, restore old calling mode
xor al,0x02 ; switch modes : show cursor <-> get mouse state
; updating XY every second loop plus drawing
@mfe7
mfe7 / Connect Loomo to Ubuntu PC for ROS
Last active May 11, 2022 12:15
Connect Loomo to Ubuntu PC for ROS
It's relatively easy to just put the Loomo and PC on the same wifi network, start a ROS master on the PC, and pass messages.
But it's preferable to have a hard-wire connection between the two devices, since it should be faster and more relibale than WiFi.
In particular, we will use USB tethering from Android->PC in these instructions.
Note: This method allows the ROS master to be set either on PC or Android! And no root access needed on Android.
--------------------------------------------------
Switch Loomo into Developer Mode (Settings > System > Loomo Developer > Developer Mode)
- (I think this requires an internet connection, so join a wifi network now.)
You might need to switch Android into Developer Mode (tap some setting 7 times...look online for instructions).
@roxlu
roxlu / primitive-restart.cpp
Created January 16, 2018 09:56
Basic example of using primitive restart
/*
---------------------------------------------------------------
oooo
'888
oooo d8b .ooooo. oooo ooo 888 oooo oooo
'888""8P d88' '88b '88b..8P' 888 '888 '888
888 888 888 Y888' 888 888 888
888 888 888 .o8"'88b 888 888 888
@rsodre
rsodre / transformToFit.h
Created March 23, 2017 14:27
Transform matrix to fit any rect into any other rect. For OpenFrameworks (or anything else, really)
#pragma once
#include "ofMain.h"
void transformToFit( ofRectangle src, ofRectangle dst, bool upscale=true ) {
// Scale
float scaleX = ( dst.width / src.width );
float scaleY = ( dst.height / src.height );
float sc = ( scaleX < scaleY ? scaleX : scaleY );
if ( ! upscale )
sc = ofClamp( sc, 0.0f, 1.0f );
// Position (scaled)
@Jakuje
Jakuje / README.md
Last active December 1, 2023 17:36
OpenSC test Sign, Verify, Encipher and Decipher from commandline with OpenSSL CLI
export PIN=111111
export SIGN_KEY=11
export ENC_KEY=55

Sign/Verify using private key/certificate

  • Create a data to sign

    echo "data to sign (max 100 bytes)" > data
    
@kashimAstro
kashimAstro / README.md
Last active May 5, 2021 17:47
H3 / Mali GPU driver and openframeworks armv7 ES / ES2

#A small guide to compile openFrameworks armv7 with driver OpenGL ES / ES2 sunxi for H3 / Mali GPU on ARMBIAN OS, compatible with orangepi and bananapi.

tested on: orangepi one banana pi M2

dependencies:

apt-get install libx11-dev libxext-dev xutils-dev libdrm-dev \ 
           x11proto-xf86dri-dev libxfixes-dev x11proto-dri2-dev xserver-xorg-dev \
 build-essential automake pkg-config libtool ca-certificates git cmake subversion