Skip to content

Instantly share code, notes, and snippets.

View foopis23's full-sized avatar

Eric Sexton foopis23

View GitHub Profile
local lastSentMessage = os.epoch() -- last time a message was sent in ms
function sendDiscordMessage(message)
local url = ''
local headers = {
['Content-Type'] = 'application/json',
}
local data = {
content = message
}
@foopis23
foopis23 / discord_alert.sh
Created April 28, 2025 14:53
A script I use on my server to send me discord messages on failed cron jobs
## Discord Alert Script
# This script sends a message to a Discord channel using a webhook.
## Usage
# ./discord_alert.sh "<message>"
## Example
# ./failing_task.sh || ./discord_alert.sh "Example Task failed..."
## CONFIG
DISCORD_WEBHOOK=<discord_webhook_url>
USER_ID=<your_user_id> # USER TO NOTIFY
@foopis23
foopis23 / update.sh
Created March 28, 2025 16:34
Half Baked Script To Update Server Mods From Modrinth Modpack
#!/bin/bash
# Define paths
MODS_DIR="./mods"
BACKUP_DIR="./backup"
MRPACK_URL="$1" # Replace with your actual Modrinth .mrpack URL
TEMP_DIR="./temp" # Temporary directory to unzip the .mrpack file
# Create the backup directory if it doesn't exist
rm -rf "$TEMP_DIR" # Remove any existing temp directory
@foopis23
foopis23 / bulma-responsive-spacing.scss
Last active December 12, 2022 18:12
bulma-responsive-spacing.scss
// import this after importing all of bulma
// add responsive spacing helpers
@each $property,
$shortcut in $spacing-shortcuts {
@each $name,
$value in $spacing-values {
// All directions
@foopis23
foopis23 / index.php
Last active August 28, 2022 18:14
A simple file UI for web server written in PHP
<?php
// CONFIG
$override_title = null; //set overide title to use instead of directory name
// END CONFIG
?>
<?php
@foopis23
foopis23 / checkout.sh
Created June 13, 2022 14:57
Checkout Latest Tag
# Get new tags from remote
git fetch --tags
# Get latest tag name
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
# Checkout latest tag
git checkout $latestTag
@foopis23
foopis23 / Example.cs
Created February 28, 2022 17:08
VRChat Send Events to Specific Players
public class ExampleUsage : UdonSharpBehaviour {
public void OnGameFinished() {
// determine the winner somehow up here
VRCSDKBaseVRCPlayerApi wiwnner = ...
// find the winner and run the teleport command on them
for (var i = 0; i < networkManager.playerIds.Length; i++)
{
if (networkManager.playerIds[i] == winner.playerId) {
networkManager.clients[i].SendCustomNetworkEvent(NetworkEventTarget.Owner, "TeleportPlayerToSpawn");
@foopis23
foopis23 / vector2.ts
Created February 22, 2022 17:31
Simple Vector2 Math
export interface Vector2 {
x: number
y: number
}
const distance = (a: Vector2, b: Vector2): number =>
Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2)
const subtract = (b: Vector2, a: Vector2): Vector2 => {
return { x: b.x - a.x, y: b.y - a.y }
@foopis23
foopis23 / vrapp.js
Created June 10, 2021 15:23
Simple Multiplayer with THREE JS & Firebase
// Option 1: Import the entire three.js core library.
import * as THREE from 'three';
import { BoxBufferGeometry, Mesh, MeshPhongMaterial } from 'three';
import { BoxLineGeometry } from 'three/examples/jsm/geometries/BoxLineGeometry.js';
import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
import { XRControllerModelFactory } from 'three/examples/jsm/webxr/XRControllerModelFactory.js';
let DB;
local width --amount of trees wide of the tree farm
local length --amount of tree length of the tree farm
local treeDistance --the distance of blocks between
local sleepTime --the amount of time between the turtle checking the tree farm for grown trees
local pos --current distance from the starting point
local direction --current direction turtle is facing
local function fuelCheck()
if turtle.getFuelLevel() == 0 then
for i=1,15,1 do