Skip to content

Instantly share code, notes, and snippets.

View dannyhvc's full-sized avatar
🌐
Reading MOS 6502 instructions

Daniel Herrera-Vasquez dannyhvc

🌐
Reading MOS 6502 instructions
View GitHub Profile
@dannyhvc
dannyhvc / python_env_launch_json.json
Last active April 13, 2022 16:42
Python ENV VARS
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
@dannyhvc
dannyhvc / indexOfInstances.py
Last active September 30, 2021 04:57
index of instances
def index_of_instances(container, value_to_find):
return [i for i, x in enumerate(container) if x == value_to_find]
@dannyhvc
dannyhvc / Q_rsqrt.c
Created September 30, 2021 05:01
the famous Q_rsqrt
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
@dannyhvc
dannyhvc / re_idx_filter.py
Last active October 29, 2021 05:46
regex_index_filtering
pattern = re.compile(
r"(\[START\])|"
r"(\[PUSH\])|"
r"(\[ADD\])|"
r"(\[SUB\])|"
r"(\[[0-9]+(.)??[0-9]*\])|"
r"(\[POP\])|"
r"(\[FINISH\])")
spam = pattern.findall("[PUSH][1000][PUSH][3645][POP][FINISH]")
@dannyhvc
dannyhvc / App.java
Last active September 11, 2023 16:42
javafx in vscode and no build tools
// jfx imports
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
// java lib imports
import java.io.File;
import java.net.URL;
@dannyhvc
dannyhvc / pom.xml
Last active February 18, 2024 21:23
javafx in vscode with maven
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0-SNAPSHOT</version>
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}/target/debug/${workspaceFolderBasename}.exe",
"args": [],
"stopAtEntry": false,
@dannyhvc
dannyhvc / README.md
Last active June 30, 2024 04:43
My Personal Helix + Wezterm config

This is my daily driver config for all my devices