Skip to content

Instantly share code, notes, and snippets.

View hugo4715's full-sized avatar
๐Ÿ˜
Always coding

hugo4715

๐Ÿ˜
Always coding
View GitHub Profile
@unitycoder
unitycoder / RayBoxIntersectFast.cs
Last active October 5, 2022 21:07
RayBoxIntersect Faster than bounds.IntersectRay
// this is faster than unity *.bounds.IntersectRay(ray)
// original source https://gamedev.stackexchange.com/a/103714/73429
float RayBoxIntersect(Vector3 rpos, Vector3 rdir, Vector3 vmin, Vector3 vmax)
{
float t1 = (vmin.x - rpos.x) / rdir.x;
float t2 = (vmax.x - rpos.x) / rdir.x;
float t3 = (vmin.y - rpos.y) / rdir.y;
float t4 = (vmax.y - rpos.y) / rdir.y;
float t5 = (vmin.z - rpos.z) / rdir.z;
@mrbar42
mrbar42 / README.md
Last active April 9, 2025 18:03
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8

Keybase proof

I hereby claim:

  • I am hugo4715 on github.
  • I am hugo4715 (https://keybase.io/hugo4715) on keybase.
  • I have a public key whose fingerprint is 1578 491A 87A8 85CC 507F 5B09 E1C8 B51C D252 1ED0

To claim this, I am signing this object:

<?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>
<artifactId>${artifactId}</artifactId>
<groupId>${groupId}</groupId>
<version>${version}</version>
<!-- Repositories -->
<repositories>
@ron4stoppable
ron4stoppable / Migration Create Sessions
Last active June 28, 2018 11:07 — forked from harris21/Migration Create Sessions
Create CodeIgniter Sessions Migration
class Migration_Create_Sessions extends CI_Migration {
// The session table structure changed for CI 3.0
public function up()
{
$fields = array(
'id VARCHAR(40) DEFAULT \'0\' NOT NULL',
'ip_address VARCHAR(45) DEFAULT \'0\' NOT NULL',
'timestamp INT(10) unsigned DEFAULT 0 NOT NULL',
'data blob NOT NULL'
import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class AIUtils {
private static Field fromMobSpawner;
private static Method getHandle;
@zyuiop
zyuiop / README.MD
Last active August 6, 2024 20:01
A simple tool to manage scoreboards in minecraft (lines up to 48 characters !). /

About

This class allow you to use a scoreboard as a sign in which you can write any text. It is designed to be used with a CraftBukkit server (or any similar variant). It uses fake teams to allow lines that are longer than usernames.

Other versions

private static Method getHandleMethod;
private static Field pingField;
private static int getPing(Player player) {
try {
if (getHandleMethod == null) {
getHandleMethod = player.getClass().getDeclaredMethod("getHandle");
getHandleMethod.setAccessible(true);
}
Object entityPlayer = getHandleMethod.invoke(player);
private static Object minecraftServer;
private static Field recentTps;
public static double[] getRecentTps() {
try {
if (minecraftServer == null) {
Server server = Bukkit.getServer();
Field consoleField = server.getClass().getDeclaredField("console");
consoleField.setAccessible(true);
minecraftServer = consoleField.get(server);