Skip to content

Instantly share code, notes, and snippets.

View JoshLmao's full-sized avatar
🐼
小熊猫比熊猫多可爱

Josh Shepherd JoshLmao

🐼
小熊猫比熊猫多可爱
View GitHub Profile
@JoshLmao
JoshLmao / AWidgetHUD.cpp
Last active February 12, 2023 02:57
UE4 C++ HUD to add an array of widgets to the Viewport on BeginPlay - (Dont forget to add "UMG" to your project.Build.cs's PublicDependencyModuleNames property)
#include "AWidgetHUD.h"
#include "Blueprint/UserWidget.h"
AWidgetHUD::AWidgetHUD()
{
}
void AWidgetHUD::BeginPlay()
{
Super::BeginPlay();
@JoshLmao
JoshLmao / MatrixMultiplication.cs
Created October 15, 2020 16:06
Matrix Multiplication within C# with comments
using System;
namespace MatrixMultiplication
{
/// <summary>
/// Multiplies matrices together using 2d arrays
/// Uses a method to easily send a "thread index" which represents the position in the Z matrix.
/// </summary>
class MatrixMultiplication
{
@JoshLmao
JoshLmao / UE4_SphereOverlapActors_Example
Created April 17, 2020 09:22
Little guide on how to use UE4's UKismetSystemLibrary::SphereOverlapActors
#include "Kismet\KismetSystemLibrary.h"
// Set what actors to seek out from it's collision channel
TArray<TEnumAsByte<EObjectTypeQuery>> traceObjectTypes;
traceObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_Pawn));
// Ignore any specific actors
TArray<AActor*> ignoreActors;
// Ignore self or remove this line to not ignore any
ignoreActors.Init(this, 1);
@JoshLmao
JoshLmao / UE4_FSM_Structure.cpp
Last active May 16, 2024 18:37
🎮 UE4 C++ Finite State Machine - Basic Structure Example
#include "UE4_FSM_Structure.h"
// Sets default values
AUE4_FSM_Structure::AUE4_FSM_Structure()
{
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
@JoshLmao
JoshLmao / Firebase_RealtimeDB_Backup.py
Created June 13, 2019 10:34
Firebase Backup.py - Python script for automatically vising endpoints of a Realtime Firebase database and combining the JSON into one for saving to a file , every X amount of seconds
# Firebase Database Backup
# Created by @JoshLmao
#
# Description: On Firebase, you're allowed to Import and Export JSON into a real time database. If for some reason that database is breached
# without being a paid user of Firebase, you are at risk of losing a lot of data. Firebase doesn't allow user's to access the root of their database through
# the WebAPI, however you can access each child object at the url "https://[PROJECT-ID].firebaseio.com/[PATH-TO-CHILD].json"
#
# How to Use: Simply add each child from the master and it's url to the 'endpointsDict' in main(). For example, If your database had...
# -> MyDatabase
# -> Users
@JoshLmao
JoshLmao / FinalProject.ino
Created April 17, 2019 18:32
Microphone Temperature Controller & LED Display
/* Josh Shepherd - 1700471
* Microphone Temperature Controller & LED Display
*
* Purpose:
* Monitors the current temperature and opens a window connected
* to a servo if it gets too hot. Can also display warm or cold color
* on LED.
* Microphone monitors for sound and changes to red LED and closes the window
* if the volume hits maximum (User shouts to close window).
* Will remain closed for 30 minutes and opens if temperture is too hot
@JoshLmao
JoshLmao / ReactiveSoundCube.ino
Last active March 20, 2019 14:52
Reactive Sound Cube 💡
/* Original by Najad on Hackster.io
* https://www.hackster.io/najad/reactive-sound-color-changing-cube-fdf705
*
* Altered by JoshLmao
* https://joshlmao.com
*/
#include "FastLED.h"
#define NUM_LEDS 10
#define DATA_PIN 5