Skip to content

Instantly share code, notes, and snippets.

@jvcleave
jvcleave / distccd-rpi.plist
Last active April 30, 2024 06:27
mac distcc install instructions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>distccd-rpi</string>
<key>Program</key>
<string>/Users/YOUR_USER_NAME/Scripts/launchd-distccd.sh</string>
<key>RunAtLoad</key>
<true/>
@jvcleave
jvcleave / vector_vs_stack_array.cpp
Created February 15, 2024 05:43 — forked from mdmaas/vector_vs_stack_array.cpp
Simple performance benchmark of stack, heap, and pre-allocated arrays and std::vector
// g++ vector_vs_stack_array.cpp -O3 -o vector
#include <numeric>
#include <vector>
#include <chrono>
#include <iostream>
#include <cmath>
using namespace std::chrono;
double sumNewArray( int N ) {
@jvcleave
jvcleave / eglinfo
Last active December 7, 2023 15:16
Raspberry Pi GL extensions
source
http://pastebin.com/raw.php?i=Vnje5sEe
gcc -o eglinfo eglinfo.c -lEGL -lGLESv2 -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -L/opt/vc/lib
EGL
Vendor: Broadcom
Version: 1.4
Client APIs: OpenGL_ES OpenVG
#include <iostream>
#include <csignal>
#include <stdexcept>
// Global variable to track whether an exception was thrown
bool exceptionThrown = false;
// Signal handler function
void signalHandler(int signum) {
BASIC
7E05 0301 06FF FF00 EF
7E05 0300 06FF FF00 EF
7E05 0301 06FF FF00 EF
7E05 0302 06FF FF00 EF
7E05 03D4 06FF FF00 EF
7E05 03C1 06FF FF00 EF
7E05 03C2 06FF FF00 EF
7E05 03C3 06FF FF00 EF
7E05 03C4 06FF FF00 EF
$ sudo gatttool -I
[ ][LE]> connect BE:16:B2:00:04:6C
Attempting to connect to BE:16:B2:00:04:6C
Connection successful
[BE:16:B2:00:04:6C][LE]> characteristics
handle: 0x0002, char properties: 0x12, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0005, char properties: 0x10, char value handle: 0x0006, uuid: 0000fff4-0000-1000-8000-00805f9b34fb
handle: 0x0008, char properties: 0x06, char value handle: 0x0009, uuid: 0000fff3-0000-1000-8000-00805f9b34fb
@jvcleave
jvcleave / libpng.sh
Created January 1, 2017 05:49 — forked from dulacp/libpng.sh
Download & Compile Libpng for iOS (all architectures)
# Builds a Libpng framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libpng in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libpng you want to build, shove it in the
# same directory as this script, and run "./libpng.sh". Grab a cuppa. And voila.
@jvcleave
jvcleave / openframeworks jetson nano.txt
Last active March 1, 2023 10:10
openframeworks jetson nano instructions
Nightly required - get link from the bottom of this page (e.g. https://openframeworks.cc/ci_server/versions/nightly/of_v20190324_linuxarmv7l_nightly.tar.gz)
https://openframeworks.cc/download/
Download OF and unpack:
wget https://openframeworks.cc/ci_server/versions/nightly/of_v20190324_linuxarmv7l_nightly.tar.gz
tar -zxvf of_v20190324_linuxarmv7l_nightly.tar.gz
mv of_v20190324_linuxarmv7l_nightly openFrameworks
@jvcleave
jvcleave / gist:4760707
Last active February 24, 2023 22:24
git cheatsheet
//git remove missing files
git rm $(git ls-files --deleted)
//replace master with goodbranch
git checkout goodbranch
git merge -s ours master
git checkout master
git merge goodbranch
@jvcleave
jvcleave / FragmentTemplate.kt
Last active November 16, 2022 06:22
Android FragmentTemplate
package com.whatever
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.whatever.databinding.FragmentTemplateBinding