Skip to content

Instantly share code, notes, and snippets.

View jasonmnemonic's full-sized avatar

Jason M jasonmnemonic

View GitHub Profile
@jasonmnemonic
jasonmnemonic / app.js
Created November 9, 2023 16:28 — forked from sanjeevbishnoi/app.js
Electron JS main App.js file
import path from 'path'
import url from 'url'
import { app, crashReporter, BrowserWindow, Menu, globalShortcut } from 'electron'
const isDevelopment = (process.env.NODE_ENV === 'development')
let mainWindow = null
let forceQuit = false
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
@jasonmnemonic
jasonmnemonic / rpi-hdmi.sh
Created June 29, 2022 13:30 — forked from AGWA/rpi-hdmi.sh
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in

Less Cheatsheet

less {filename}
Navigation
SPACE forward one window
b backward one window
d forward half window

In the name of God

Raspberry Pi Hardware ID

The following C++ code, shows how to get Raspberry Pi hardware ID(s) in various ways. You can concatenate the strings and calculate it's hash to take Raspberry Pi Fingerprint:

rpid.cpp:

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@jasonmnemonic
jasonmnemonic / result.md
Created January 21, 2022 16:48 — forked from Terminus-IMRC/result.md
mmal_list_supported_encodings result
@jasonmnemonic
jasonmnemonic / main.cpp
Created September 20, 2021 14:38 — forked from metalinspired/main.cpp
TMC2209 UART
/**
* Author Milan Divkovic
*
* You can control the motor with following commands:
* 0: Disables the motor
* 1: Enables the motor
* + or -: Increase or decrease speed in respect to rotation direction
*/
#include <Arduino.h>
libdir = /opt/opencv-4.1.0/lib
includedir = /opt/opencv-4.1.0/include/opencv4
Name: OpenCV
Description: OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library.
Version: 4.1.0
Libs: -L${libdir} -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_calib3d -lopencv_ccalib -lopencv_core -lopencv_datasets -lopencv_dnn_objdetect -lopencv_dnn -lopencv_dpm -lopencv_face -lopencv_features2d -lopencv_flann -lopencv_freetype -lopencv_fuzzy -lopencv_gapi -lopencv_hfs -lopencv_highgui -lopencv_imgcodecs -lopencv_img_hash -lopencv_imgproc -lopencv_line_descriptor -lopencv_ml -lopencv_objdetect -lopencv_optflow -lopencv_phase_unwrapping -lopencv_photo -lopencv_plot -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_shape -lopencv_stereo -lopencv_stitching -lopencv_structured_light -lopencv_superres -lopencv_surface_matching -lopencv_text -lopencv_tracking -lopencv_videoio -lopencv_video -lopencv_videostab -lopencv_xfeatures2d -lopencv
@jasonmnemonic
jasonmnemonic / GNU-Make.md
Created March 29, 2021 11:45 — forked from rueycheng/GNU-Make.md
GNU Make cheatsheet