Skip to content

Instantly share code, notes, and snippets.

View raffitz's full-sized avatar

Rafael Gonçalves raffitz

View GitHub Profile
@raffitz
raffitz / biomesoplenty-models.txt
Created March 17, 2021 01:34
Dynmap biomesoplenty renderdata fix
modname:biomesoplenty
# Generated by Dynmap Block Scan, hand modified by raffitz to include biomesoplenty fluids and to correctly render the grass
patch:id=patch0,Ox=0.950000,Oy=0.000000,Oz=0.950000,Ux=0.050000,Uy=0.000000,Uz=0.050000,Vx=0.950000,Vy=1.000000,Vz=0.950000,Umin=0.000000,Umax=1.000000,Vmin=0.000000,Vmax=1.000000,VmaxAtUMax=1.000000,VminAtUMax=0.000000,visibility=top
patch:id=patch1,Ox=0.050000,Oy=0.000000,Oz=0.050000,Ux=0.950000,Uy=0.000000,Uz=0.950000,Vx=0.050000,Vy=1.000000,Vz=0.050000,Umin=0.000000,Umax=1.000000,Vmin=0.000000,Vmax=1.000000,VmaxAtUMax=1.000000,VminAtUMax=0.000000,visibility=top
patch:id=patch2,Ox=0.050000,Oy=0.000000,Oz=0.950000,Ux=0.950000,Uy=0.000000,Uz=0.050000,Vx=0.050000,Vy=1.000000,Vz=0.950000,Umin=0.000000,Umax=1.000000,Vmin=0.000000,Vmax=1.000000,VmaxAtUMax=1.000000,VminAtUMax=0.000000,visibility=top
patch:id=patch3,Ox=0.950000,Oy=0.000000,Oz=0.050000,Ux=0.050000,Uy=0.000000,Uz=0.950000,Vx=0.950000,Vy=1.000000,Vz=0.050000,Umin=0.000000,Umax=1.000000,Vmin=0.000000,Vmax
@raffitz
raffitz / poke-cat.py
Last active July 16, 2020 00:54
Pokémon gen iii structure reader
#!/usr/bin/env python
import argparse
import struct
parser = argparse.ArgumentParser(description='Read a gen iii pokémon')
parser.add_argument('pokemon', action='store',
help='Binary pokémon file to be read')
args = parser.parse_args()
@raffitz
raffitz / hbfi.hs
Created January 26, 2017 00:04
A quick and easy brainfuck interpreter in Haskell. Pretty much unreadable.
import System.Exit
import System.Environment
import Data.Char
import Control.Monad
skipAhead :: String -> (String,String)
skipAhead [] = ([],[])
skipAhead str = skipAhead' str "" 1
where skipAhead' "" bhd _ = ("",bhd)
skipAhead' ahd bhd 0 = (ahd,bhd)
@raffitz
raffitz / KMSS.sh
Last active December 4, 2016 19:54
Minimalist, potentially dangerous, KSP mod managing script.
#!/usr/bin/env bash
# Kerbal Mods Shell Script
#
# by raffitz
# Default Vatiable Declaration:
DEFKMSSGAMEFOLDER="${HOME}/.local/share/Steam/steamapps/common/Kerbal Space Program"
DEFKMSSFOLDER="${HOME}/Documents/KMSS"

Keybase proof

I hereby claim:

  • I am raffitz on github.
  • I am raffitz (https://keybase.io/raffitz) on keybase.
  • I have a public key whose fingerprint is 2A32 956D DC2F 4F58 E515 6115 307D CDF7 7767 D1BF

To claim this, I am signing this object:

@raffitz
raffitz / squaretri.hs
Created July 13, 2016 15:10
Script to find triangular numbers that are simultaneously square numbers.
squares :: (Integral a) => [a]
squares = map (\x -> x*x) [1..]
triangles :: (Integral a) => [a]
triangles = map (\x -> (div (x*(x+1)) 2)) [1..]
match :: (Integral a) => [a] -> [a] -> [a]
match (a:as) (b:bs)
| a == b = a:(match as bs)
@raffitz
raffitz / quadint.m
Created July 3, 2016 23:07
Quadruple integral to calculate average distance between two random points within a unit square
% Matlab script to determine average distance between two random points within a unit square
f=@(x,y,z,w) sqrt((x-z).*(x-z) + (y-w).*(y-w)); % Distance Function between points (x,y) and (z,w)
a=0.5;b=0.5;c=0.5;d=0.5; % Integration limits: -a<=x<a -b<=y<b -c<=z<c -d<=w<d
I=integral2(@(x,y)arrayfun(@(x,y)integral2(@(z,w)f(x,y,z,w),-c,c,-d,d),x,y),-a,a,-b,b)