Skip to content

Instantly share code, notes, and snippets.

View jaygarcia's full-sized avatar
😁

Jay Garcia jaygarcia

😁
  • Washington DC
View GitHub Profile
@jaygarcia
jaygarcia / Evade2-boss-song-01.atm.json
Last active December 28, 2023 00:40
ATMLib2 example JSON
{
"fx": {
"enabled": false,
"status": {
"fxType": "channel",
"id": 1
},
"channel": {
"0": {
"flags": 1048577,
@jaygarcia
jaygarcia / install-boost-and-cmake.sh
Last active August 6, 2019 20:35
Setting up a Diet Pi for the RGB biznas
mkdir -p tmp
cd tmp
#BOOST
echo "Downloading Lib Boost 1.70.0 ...."
wget -c https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz -O - | tar -xz
echo "Downloading CMake..."
@jaygarcia
jaygarcia / Lenovo_Device_Driver_Script_Generator.js
Last active May 22, 2019 17:54
JavaScript code to create a quick BASH script to download Lenovo device drivers (and rename them) -- because their process is a time suck!
/**
Requirements: Linux or macOS with curl, chrome (+ dev tools) installed.
Demo: https://twitter.com/ModusJesus/status/1131255310704873472
Step 1: Go to a Lenovo device driver page like: https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t580-type-20l9-20la/downloads
Step 2: Copy and paste the below code & run
Step 3: Copy the CURL output
Step 4: Paste in a text file and run via bash.
Step 5: Do something that is more useful than having to click a ton of times to download device drivers and rename them.
*/
@jaygarcia
jaygarcia / rpi-rgb-tcipip-sender-example.cpp
Created April 18, 2019 19:53
rpi-rgb-led-matrix example using TCP/IP to fill a display (SENDER)
/*
This is a non-threaded & blocking TCP/IP sender program to your RPI running hzeller's RGB Matrix
thread.
It will loop and create a random color, sending `totalBytes` to the receving pi.
Original thread: https://github.com/hzeller/rpi-rgb-led-matrix/issues/796
Client example: https://gist.github.com/jaygarcia/c8b0ce341b36c453c869fc2fe8c4f29c
*/
@jaygarcia
jaygarcia / rpi-rgb-tcipip-receiver-example.cpp
Last active April 19, 2019 19:41
rpi-rgb-led-matrix example using TCP/IP to fill a display (RECEIVER)
/*
This gist demonstrates how to setup threaded & blocking (probably could have used the async transfer instead)
Boost ASIO server to receive a number of bytes from a client. It was developed as a proof of concept and has many areas that
could be improved for speed. I ran this on a Raspberry PI 3b+ using the active RGB Matrix board from electrodragon.
Here's a demonstration this code executing on the PI 3b+ pumping 49,152 bytes for the video data ((6 x (64x64 rgb matrices) * 2).
https://www.youtube.com/watch?v=ODnbhvbLX9E&feature=youtu.be
This works spawning two threads (Network & Display)
@jaygarcia
jaygarcia / main.cpp
Last active December 9, 2018 16:27
libxmp replay bug
#include <SDL2/SDL.h>
#include <SDL2/SDL_audio.h>
#include "xmp.h"
#include "sndfile.h"
#include "stdlib.h"
#include "string.h"
#define SAMPLE_RATE 44100
#define CHANNELS 2
@jaygarcia
jaygarcia / gist:8a73aa72b212b194a0314ab4b5a2b090
Created May 7, 2018 15:01
Ubuntu 18.04 LTS Parallels tools install error
Hit:1 http://us.archive.ubuntu.com/ubuntu artful InRelease
Hit:2 http://security.ubuntu.com/ubuntu artful-security InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu artful-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu artful-backports InRelease
Reading package lists...
Return code from apt-get update is 0
Selecting previously unselected package dkms.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
renderer.block = ^(const AERenderContext * _Nonnull context) {
AEBufferStack *bufferStack = context->stack;
const AudioBufferList * bufferList = AEBufferStackPushWithChannels(bufferStack, 1, 2);
if ( !bufferList ) {
return;
}
PROGMEM const unsigned char A[] = {
7, 6,
0x20, 0x38, 0x2E, 0x23, 0x27, 0x1C, 0x30
};
PROGMEM const unsigned char B[] = {
6, 6,
0x3F, 0x21, 0x21, 0x2D, 0x3F, 0x12
};
@jaygarcia
jaygarcia / gist:c70e7285a013ec44ff57
Created March 20, 2016 13:15
Set iOS lowest most view background to an image for ReactNative.
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"GORUCK"
initialProperties:nil
launchOptions:launchOptions];
// JG: Configure the scaled image for the background
CGRect bounds =[UIScreen mainScreen].bounds;
UIGraphicsBeginImageContext(bounds.size);