Skip to content

Instantly share code, notes, and snippets.

View Rafael09ED's full-sized avatar
🖥️

Rafael DeJesus Rafael09ED

🖥️
View GitHub Profile
@Rafael09ED
Rafael09ED / cup.ts
Last active February 10, 2025 20:32
let working = true;
const coffee = {
coffeeAmount: 10,
drink: () => { coffee.coffeeAmount -= 5; },
[Symbol.toPrimitive]() {
return coffee.coffeeAmount === 0 ? "empty" : coffee.coffeeAmount
},
refill: () => {
@Rafael09ED
Rafael09ED / ipynb_code.py
Last active April 11, 2024 03:29
Running Typescript code from Python
import subprocess
import json
script_name = "typescript_code.ts"
json_data = json.dumps({"key": "value"})
try:
result = subprocess.run(
["npx", "tsx", "getPageMd.ts", json_data],
cwd=os.path.join(os.getcwd(), "../other_directory/cmd_scripts/"),
capture_output=True,
%pip install scipy matplotlib pandas
import numpy as np
import datetime
from matplotlib import pyplot as plt
from shapely.geometry import LineString
import matplotlib.dates as mdates
import matplotlib
from datetime import date
from dateutil.relativedelta import relativedelta
@Rafael09ED
Rafael09ED / hyperlinkKeyTermsBookmarklet.js
Last active December 20, 2020 01:54
Bookmarklet to hyperlink key words on a webpage to matching Wikipedia page
javascript:(function() {
var dolchWords = "a all after always about apple home and am again around better baby horse away are an because bring back house big at any been carry ball kitty blue ate as before clean bear leg can be ask best cut bed letter come black by both done bell man down brown could buy draw bird men find but every call drink birthday milk for came fly cold eight boat money funny did from does fall box morning go do give don't far boy mother help eat going fast full bread name here four had first got brother nest I get has five grow cake night in good her found hold car paper is have him gave hot cat party it he his goes hurt chair picture jump into how green if chicken pig little like just its keep children rabbit look must know made kind Christmas rain make new let many laugh coat ring me no live off light corn robin my now may or long cow Santa Claus not on of pull much day school one our old read myself dog seed play out once right never doll sheep red please open sing only door shoe ru
package com.github.rafael09ed.nMMModProfileExporter;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author Rafael
/**
* FalloutNMMModListParser.java
* Purpose: Generates List of mods w/ links do downloads from a profile modlist.xml file
* specifically formatted for reddit
*
* @author Rafael09ED
* @version 1.0 2/15/2017
*/
import org.w3c.dom.Document;
@Rafael09ED
Rafael09ED / CompressingCastingSwitches.java
Last active August 30, 2018 14:11
Method for casting from a generic type to a more specific type and making it easier to handle. Avoid doing this.
//Making Interfaces Like this:
public interface Data_TypeStringGenericActable<T> {
T act(Data_TypeString data);
}
public interface Data_TypeUriGenericActable<T> {
T act(Data_TypeURI data);
}
//So I can make methods like this:
public static <T> T genericSwitch(Data data,
Data_TypeStringGenericActable<T> stringActable,
@Rafael09ED
Rafael09ED / Hangman.java
Created May 20, 2015 14:39
Simple Hangman Program w/ GUI
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;