Skip to content

Instantly share code, notes, and snippets.

View ste2425's full-sized avatar

Stephen Cooper ste2425

View GitHub Profile
@ste2425
ste2425 / exports.exp
Last active October 23, 2025 08:20
glib2d prx issue repro
# Define the exports for the prx
PSP_BEGIN_EXPORTS
# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC(module_start)
PSP_EXPORT_FUNC(module_stop)
PSP_EXPORT_VAR(module_info)
PSP_EXPORT_END
@ste2425
ste2425 / main.c
Created August 18, 2025 19:16
IntraFont && sprite render issue
#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdisplay.h>
#include <pspgu.h>
#include <memory.h>
#include <intraFont.h> // Add this
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
@ste2425
ste2425 / esp32opditto.ino
Created July 11, 2025 09:21
opDitto ESP32 + Bluepad32
#include <Bluepad32.h>
ControllerPtr myControllers[BP32_MAX_GAMEPADS];
uint8_t RXX = 0;
uint8_t RYY = 0;
// This callback gets called any time a new gamepad is connected.
// Up to 4 gamepads can be connected at the same time.
void onConnectedController(ControllerPtr ctl) {
@ste2425
ste2425 / tileMapOffset.js
Created June 23, 2021 09:19
Offset TileMap for fonts used in GBDK-2020
/*
font tiles in GBDK are always inserted at the start.
This script will offset existing tile maps by the number of
tiles in the font.
*/
const fontTileSize = 37;
const tileMap = [/* Tile map array of hex values */];
@ste2425
ste2425 / penisExtension.ps1
Created November 28, 2018 13:59
Penis Extension.
<#
Will install a VSCode extension.
https://github.com/hoovercj/vscode-power-mode
Sets a custom image.
Best to put this on a share then execute on anyones machine that they leave unlocked.
**NOTE**
It will merge with their existing settings.json. May want to take a backup first.
@ste2425
ste2425 / enumerator.js
Last active August 1, 2018 07:34
Close Contacts Enumerator polly-fill
if (!window.Enumerator) {
window.Enumerator = function (c) {
this._c = Array.from(c);
this._index = 0;
}
window.Enumerator.prototype.atEnd = function () {
return this._index >= this._c.length - 1;
}
@ste2425
ste2425 / .gitignore
Created July 23, 2017 17:46 — forked from iffy/.gitignore
Example using electron-updater with `generic` provider.
node_modules
dist/
yarn.lock
wwwroot
@ste2425
ste2425 / store.js
Last active May 12, 2017 14:27
Electron persistent store
'use stirct';
const electron = require('electron'),
userDataPath = (electron.app || electron.remote.app).getPath('userData'),
path = require('path'),
fs = require('fs');
class Store {
constructor(configName = '') {
// Probably want to implement error handling
@ste2425
ste2425 / disableValidation.js
Created December 2, 2016 14:06
Prevent validation on disabled and hidden elements
.directive('ignoreDisabled', ['$exceptionHandler', ($exceptionHandler) => {
return {
restrict: 'A',
require: 'ngModel',
link: ($scope, elem, attr, ctrl) => {
if (!attr.hasOwnProperty('ngDisabled')) {
$exceptionHandler(new ReferenceError('Attempt to use ignoreDisabled on element without ngDisabled.'));
} else {
$scope.$watch(attr.ngDisabled, (val, oldVal) => {
if (val === true && val !== oldVal) {
@ste2425
ste2425 / promisifyExample.js
Created November 2, 2016 16:08
Little promisify helper
let promisify = (fn) => (...args) =>
new Promise((rCB, eCB) =>
fn(...args, (e, r) => {
if (e)
eCB(e);
else
rCB(r);
}));
promisify(sass.render({