Skip to content

Instantly share code, notes, and snippets.

@GorgeousOne
GorgeousOne / skysphere-to-skybox.py
Last active May 9, 2023 22:50
lazy python script to convert a skysphere images to 6 skybox images. probably can't smooth pixels from small images very well
import numpy as np
from PIL import Image
def raycast_box_imgs(sphere_img, new_img_size, out_dir):
"""renders and saves all 6 sides of the skybox"""
rays = create_rays(new_img_size)
rotations = {
"ft": np.eye(3),
"lt": rot_y_mat(-.5 * np.pi),
@GorgeousOne
GorgeousOne / OrbitCamera.pde
Last active June 30, 2023 05:58
A blender like 3d orbiting camera for Processing. It enables rotation and movement in the scene with LMB and RMB
import java.awt.Toolkit;
/* Example Project
OrbitCamera cam;
void settings() {
size(1200, 800, P3D);
smooth();
}
void setup() {
cam = new OrbitCamera();
@MrProgramerShah
MrProgramerShah / custom-file-upload-button-html-css-javascript.markdown
Created November 1, 2019 09:13
Custom File Upload Button | HTML + CSS + JavaScript
@LeeGodSRC
LeeGodSRC / Multi Block Changer - Spigot
Last active October 10, 2023 02:27
This is probably the most performance efficient block changer , i tried my best to make it simpler to use , if you have any ideas on it , feel free to give me suggestions!
import java.util.ArrayDeque;
import java.util.Queue;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
import org.bukkit.material.MaterialData;
@peterfoot
peterfoot / BrightnessHelper.cs
Last active July 23, 2023 22:09
Set the display brightness from a Win32 application
public static class BrightnessHelper
{
public static void SetBrightness(uint brightness)
{
if (brightness > 100)
{
throw new ArgumentOutOfRangeException("brightness");
}
// get handle to primary display
@dgovil
dgovil / windowPositions.py
Created January 21, 2017 04:08
Saving Window Positions in PyQt or PySide
# First lets import the two modules we'll need from Qt
from Qt import QtWidgets, QtCore
# Then we create our Window class, in this case from a QDialog
class MyWindow(QtWidgets.QDialog):
def __init__(self):
# We use the __init__ method to initialize it
# The super function gets the class we are inheriting from (in this case QDialog) and calls its' __init__ as well
@MiniDigger
MiniDigger / StructureUtil.java
Last active May 27, 2021 09:07
Small util to load and save structures, using nms and reflection
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.util.Vector;
/**
* Small util to load and save structures<br>
@isabek
isabek / parallel_matrix_multiplication.cpp
Created June 2, 2016 20:58
Parallel Matrix Multiplication on Open MPI.
#include <stdio.h>
#include <mpi.h>
#include <algorithm>
#include <ctime>
#define GRN "\x1B[32m"
#define RESET "\x1B[0m"
#define CYN "\x1B[36m"
#define MASTER_RANK 0
@aadnk
aadnk / EntityHider.java
Last active April 25, 2024 22:47
Hide or show entities
package com.comphenix.example;
import static com.comphenix.protocol.PacketType.Play.Server.*;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Map;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;