Skip to content

Instantly share code, notes, and snippets.

@spheenik
spheenik / 2.12.0.patch
Last active February 16, 2023 21:01
QEMU sound improvement
diff --git audio/audio.c audio/audio.c
index 6eccdb17ee..4eb190a18f 100644
--- audio/audio.c
+++ audio/audio.c
@@ -2097,3 +2097,8 @@ void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol)
}
}
}
+
+int64_t audio_get_timer_ticks(void)
@spheenik
spheenik / README.md
Created August 19, 2016 18:31
Autmatically set max display brightness on suspend on Dell XPS 9550
  • cp fix-backlight.service /etc/systemd/system/
  • cp max_backlight /usr/local/bin/
  • chmod a+x /usr/local/bin/max-backlight
  • systemctl enable fix-backlight
@spheenik
spheenik / A_getItemName.java
Last active August 29, 2015 14:20
Example code for getting item names in clarity 1.
// e = hero entity
// n = num of item slot
public static String getItemName(Match match, Entity e, int num) {
int handle = e.getProperty(String.format("m_Inventory.m_hItems.%04d", num));
if (handle == Handle.MAX) {
return "";
}
Entity item = match.getEntities().getByHandle(handle);
String name = item.getProperty("m_iName");
@spheenik
spheenik / gist:caa02067dd12e25d7bd4
Last active August 29, 2015 14:14
get abilities and corresponding heros
Iterator<Entity> iter = match.getEntities().getAllByPredicate(new Predicate<Entity>() {
@Override
public boolean apply(Entity e) {
return e.getDtClass().instanceOf("DT_DOTABaseAbility");
}
});
while (iter.hasNext()) {
Entity ability = iter.next();
Integer ownerHandle = ability.getProperty("m_hOwnerEntity");
Entity hero = match.getEntities().getByHandle(ownerHandle);
@spheenik
spheenik / entity positions
Last active August 29, 2015 14:02
entity positions
private static final int MAX_COORD_INTEGER = 16384;
public static float getVecOrigin(Entity e, int idx) {
Object v = e.getProperty("m_vecOrigin");
if (v instanceof Vector2f) {
float[] v2 = new float[2];
((Vector2f) v).get(v2);
return v2[idx];
} else if (v instanceof Vector3f) {
float[] v3 = new float[3];
@spheenik
spheenik / gist:9711125
Last active August 29, 2015 13:57
clarity: chat event dump
package skadistats.clarity.examples.simple;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import skadistats.clarity.Clarity;
import skadistats.clarity.match.Match;
import skadistats.clarity.parser.DemoInputStreamIterator;
import skadistats.clarity.parser.Peek;
import skadistats.clarity.parser.Profile;
@spheenik
spheenik / gist:9179328
Created February 24, 2014 00:11
dota string table names
downloadables
modelprecache
genericprecache
soundprecache
decalprecache
instancebaseline
lightstyles
userinfo
dynamicmodel
server_query_info