Skip to content

Instantly share code, notes, and snippets.

View unisys12's full-sized avatar

Phillip Jackson unisys12

View GitHub Profile
@unisys12
unisys12 / README.MD
Last active February 11, 2023 14:34
Parse EXML File and Display

Parsing EXML File from MBINCompiler

Since everything in these EXML documents is a Property element, it makes it very hard to navigate. So, we will layout the structure here. The structure is derived by view Parent elements name and value, followed by any child element names and values.

This is a first stab at parsing this file. I will put what I learned in the Conclusion section. I will be using native Browser API's to perform this. The only external dependency will be use of the TailwindCSS CDN.

Loose Property Structure

  • root: GcNGuiLayerData Data element
    • name: ElementData value: GcNGuiElementData.xml
    • name: Style value: TkNGuiGraphicStyle.xml
@unisys12
unisys12 / decode.js
Last active January 24, 2023 00:49
First attempt at decoding a PSARC Binary or .PAK file(from No Mans Sky) using Nodejs. This merely decodes the Header and TOC Table
const fs = require("node:fs");
const psarc_file = "./NMSARC.5A3E0C7D.pak";
// const psarc_file = "./NMSARC.2E9559C7.pak";
const hexToDecimal = (hex) => parseInt(hex, 16);
// Attempts to read a *pak file and decode it's header and
// return it as an object. Result in file below.
//
// Yes! This could be written better, but it's first draft.
// Ever wake up one morning and ask yourself, "Self! What's
@unisys12
unisys12 / alias.bat
Last active November 25, 2022 16:06
Create a alias for Laravel Sail on Windows
REM Make an alias that can be used in Windows Terminal,
REM that points to a local instance of Laravel Sail
REM
REM *OPTION 1*
REM - Create a file called alias.bat in `C:/Windows` dir
REM and copy and paste the snippet below into it.
REM - Go into the root of the project that
REM will be using Sail as a development environment and
REM type alias.bat in the terminal.
REM
@unisys12
unisys12 / edit.blade.php
Last active February 24, 2022 14:30
Generating a Select element with pre-selected options...
<select name="tags[]" id="tags" multiple>
@foreach ($tags as $tag)
<option value="{{ $tag->id }}"
@foreach ($quote->tags as $quote_tag)
@if ($tag->id == $quote_tag->pivot->tag_id) selected @endif
@endforeach
>
{{ $tag->name }}
</option>
@endforeach
@unisys12
unisys12 / generateColorVars.js
Last active September 10, 2021 16:33
Generate CSS Custom Properties from Periodic Table of Elements data using Nodejs
const fsPromise = require("fs/promises");
const cssPath = "./assets/css/vars.css";
readJson = async () => {
const path = "./assets/_data/periodic-table.json";
try {
const data = fsPromise.readFile(path, "utf-8");
data.then((fileData) => {
@unisys12
unisys12 / periodic-table.json
Created September 6, 2021 14:28
periodic-table.json
[
{
"atomicNumber": 1,
"symbol": "H",
"name": "Hydrogen",
"atomicMass": "1.00794(4)",
"electronicConfiguration": "1s1",
"electronegativity": 2.2,
"atomicRadius": 37,
"ionRadius": "unknown",
module.exports = data = () => {
return [
{
atomicNumber: 1,
symbol: "H",
name: "Hydrogen",
atomicMass: "1.00794(4)",
electronicConfiguration: "1s1",
electronegativity: 2.2,
atomicRadius: 37,
@unisys12
unisys12 / DashboardController.php
Created July 30, 2021 22:51
Passing Multiple Vars to View
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
const CLIENT_ROLE = 3;
const TRAINER_ROLE = 2;
@unisys12
unisys12 / index.rb
Created October 12, 2019 16:28
Using MongoDB as a storage vessel for the D2 MobileWorldContentFile, I wanted to put together an aggregate of the activities...
require_relative 'list_activities'
include Activities
puts Activities::list_all
@unisys12
unisys12 / Vagrantfile
Last active August 20, 2017 21:23
Vagrant config for private project
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at