Skip to content

Instantly share code, notes, and snippets.

View LouisGameDev's full-sized avatar

LouisGameDev LouisGameDev

View GitHub Profile
@twoixter
twoixter / color_streams.h
Created September 29, 2011 17:33
Colorize output streams with ANSI color codes
/*
* Copyright (c) 2011 Jose Miguel Pérez, Twoixter S.L.
*
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@joelverhagen
joelverhagen / README.md
Created February 12, 2012 02:14
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@dolt131943
dolt131943 / download InfoQ Video
Created December 29, 2012 16:35
InfoQ的视频下载
http://union.bokecc.com/playvideo.bo?uid=C089D59BA5DEEC18&playerid=58C72EF83A565238&playertype=1&autoStart=false&vid=28535D5099D7FF35
http://union.bokecc.com/servlet/playinfo?uid=C089D59BA5DEEC18&vid=28535D5099D7FF35&lid=&pid=58C72EF83A565238&pt=1&m=1&t=2&pp=false&d=union.bokecc.com&fv=WIN%2011%2C5%2C502%2C110&uu=1432E6BE318DBAA44D95462F785FBEE3B4338501&rnd=4249
与上面等效可读取,从而匹配播放地址上的参数:
http://union.bokecc.com/servlet/playinfo?uid=C089D59BA5DEEC18&vid=28535D5099D7FF35&lid=&pid=58C72EF83A565238
<?xml version="1.0" encoding="UTF-8"?>
@aadnk
aadnk / SoundlessTeethlessExplosion.java
Created August 29, 2013 21:44
Create a soundless explosion that does no damage.
package com.comphenix.example;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
@1lann
1lann / replays.md
Last active January 20, 2026 06:07
Storing and playing back replays in League of Legends

Storing and playing back replays in League of Legends

How it works

When you spectate a game in League of Legends, you tell the client to use a HTTP server, and make HTTP requests to it to retrieve data in chunks which make up a game. But what if you could return back the exact same data at a later time, simulating the spectate but viewing it at anytime? That's the concept behind replays and that's how they work.

There is some behavior in the API which I do not fully understand yet, so there are if statements to catch these edge cases.

Current game information

Before you can even get the game's metadata, you'll need to retrieve necessary information for the game. This call is part of the official Riot Games API.

/observer-mode/rest/consumer/getSpectatorGameInfo/{platformId}/{summonerId}

@FreyaHolmer
FreyaHolmer / RigidbodyMassCalculator.cs
Created December 18, 2015 19:54
Used to approximate a proper mass value for all the colliders in a given Rigidbody
using UnityEngine;
using System.Linq;
[RequireComponent(typeof(Rigidbody))]
public class RigidbodyMassCalculator : MonoBehaviour {
public float density = 1f;
public bool recalculateOnAwake = true;
Rigidbody rb;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using System.IO;
using System.Reflection;
[InitializeOnLoad]
public static class ShowFileExtensions
{
@RubenPineda
RubenPineda / DraggablePointAttribute.cs
Last active September 9, 2020 00:00
This is an updated version of ProGM's script. Now it handles Vector2, arrays and nested fields as well. You can also drag points locally. See the original code here: https://gist.github.com/ProGM/226204b2a7f99998d84d755ffa1fb39a. See also helper methods here: http://answers.unity3d.com/questions/425012/get-the-instance-the-serializedproperty-bel…
using UnityEngine;
public class DraggablePointAttribute : PropertyAttribute {
public bool local;
public DraggablePointAttribute (bool local = false) {
this.local = local;
}
}
@hiepxanh
hiepxanh / add-voice.ps
Created November 23, 2017 03:08
Add microsoft core voice to any application can use
$sourcePath = 'HKLM:\software\Microsoft\Speech_OneCore\Voices\Tokens' #Where the OneCore voices live
$destinationPath = 'HKLM:\SOFTWARE\Microsoft\Speech\Voices\Tokens' #For 64-bit apps
$destinationPath2 = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens' #For 32-bit apps
cd $destinationPath
$listVoices = Get-ChildItem $sourcePath
foreach($voice in $listVoices)
{
$source = $voice.PSPath #Get the path of this voices key
copy -Path $source -Destination $destinationPath -Recurse
copy -Path $source -Destination $destinationPath2 -Recurse
@Lazersquid
Lazersquid / Reference.cs
Last active January 30, 2023 19:44
Unity generic scriptable object variable reference pattern
using System;
/// <summary>
/// Reference Class.
/// </summary>
[Serializable]
public abstract class Reference
{
}