Skip to content

Instantly share code, notes, and snippets.

@evinjaff
evinjaff / lie_to_gpt4.js
Created March 18, 2024 20:28
Quick Demo of how function calling can overwrite training data on LLMs like OpenAI's GPT-4
OPENAI_API_KEY = "YOUR_OPENAI_KEY_HERE"
BASE_URL = "https://api.openai.com/v1/chat/completions";
async function fetchGPT(userContent, messages) {
try {
const headers = {
"Content-Type": "application/json",
"Authorization": `Bearer ${OPENAI_API_KEY}`
};
let payload;
@evinjaff
evinjaff / secretsanta.gs
Created November 28, 2023 17:28
Secret Santa gs code
DRY_RUN = true
OPENAI_API_KEY = "YOUR_API_KEY_HERE"
BASE_URL = "https://api.openai.com/v1/chat/completions";
function myFunction() {
/* Random Number Generation Setup */
// Create cyrb128 state:
var seed = cyrb128("Your Seed Phrase");
// Four 32-bit component hashes provide the seed for sfc32.
var rand = sfc32(seed[0], seed[1], seed[2], seed[3]);
@evinjaff
evinjaff / addon.xml
Created October 27, 2023 09:23
Random Startup Movie Hack for Arctic Zephyr Kodi Skin
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.autoexec" name="Autoexec Service" version="1.0.0" provider-name="evinjaff">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<extension point="xbmc.service" library="autoexec.py">
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Automatically run python code when Kodi starts.</summary>
<description lang="en_GB">The Autoexec Service will automatically be run on Kodi startup.</description>
// NES Controller FSM implementation - By Evin Jaff (2023)
// Wrote this for funsies during a DnD session with friends because I was bored
// Wanted to see if I could write some code to emulate the NES Controller signals - might use this driver code for another project
// https://tresi.github.io/nes/
// https://www.nesdev.org/wiki/Standard_controller
//Preprocessed Pins
#define LATCH_PIN 4
#define CLCK_PIN 5
@evinjaff
evinjaff / .gitignore
Created May 22, 2022 19:30 — forked from adamgit/.gitignore
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@evinjaff
evinjaff / mostlikely.js
Last active October 17, 2020 00:25
discord.js JavaScript extension I wrote that pulls the members of every guild and says who in the server is most likely to do something. Have not seen much about how to do this, so am making this for any lost discord.js developers.
/* mostlikely.js
* © 2020 By Evin Jaff
* functionality: pulls the cached map of all members on a guild, then
* outputs a random user as the most likely to (blank)
*/
module.exports = {
name: 'mostlikely',
description: 'Most likely to ...',
execute(message, args) {
//JS Module compatible with Discord.js
//Ideally if you were going to use this often, you'd try and find a better randomness library, but that's neither here nor there.
module.exports = {
name: 'statroll',
description: 'rolls stats',
execute(message, args) {
console.log("args: " + args);
//message.reply("args is " + args.toString());
if(args.includes("4d6")){
How to dump romfs and exefs using GodMode 9
1. Boot up modded 3DS into GodMode9 by holding start. If you have additional custom boot firms, highlihgt GodMode9 and press "A"
2. Select the gamecart as Select "[C:] Gamecart()" and then select the .trim.3ds file, and copy it to the clipboard by clicking "Y"
3. Then, navigate to the SDCARD (NOLABEL)/gm9/out folder and paste in the .trim.3ds file
4. Click on the .trim.3ds file and then go under "NCSD image options..." and then click "Build CIA from file"
5. Once the new CIA file has been created, click on the generated CIA file, then select "CIA image options..." and then select "Mount image to drive"
6. Once the CIA has been mounted, it will ask you to navigate to the drive, select "yes" and then once you're in the drive, open the "0000.00000000" file.
7. Once you're there, copy the romfs folder to the clipboard using "Y" and then navigate back to the gm9/out folder and paste the romfs folder in there
8. If you also want the exefs, repeat again and copy to gm9/out
@evinjaff
evinjaff / Triangle.java
Last active April 20, 2024 22:39
Recursive Sierpinski Triangle in Java
import java.awt.Color;
import sedgewick.StdDraw;
public class Triangles {
public static void triangle(double x, double y, double s, int n){
// X and y are base coordinates, s is size, n is number of recursions
@evinjaff
evinjaff / vcardsamples.txt
Last active May 14, 2020 20:32
Vcard Samples
VCARD 2.1
BEGIN:VCARD
VERSION:2.1
N:Doctor;The;;Dr.
FN:The Doctor
ORG:UNIT
TITLE:President of the World
PHOTO;GIF:http://www.example.com/dir_photos/my_photo.gif
TEL;WORK;VOICE:(111) 555-1212