Skip to content

Instantly share code, notes, and snippets.

View rtc_fixup.diff
diff --git a/twrp.cpp b/twrp.cpp
index 54f3ea6..0777784 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -60,6 +60,56 @@ static void Print_Prop(const char *key, const char *name, void *cookie) {
printf("%s=%s\n", key, name);
}
+ #include <sys/time.h>
+#include <dirent.h>
View tcp_test.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <fcntl.h>
@Tasssadar
Tasssadar / twrp_fonts.py
Last active Aug 29, 2015
Python script to convert TrueType fonts to TWRP's .dat format.
View twrp_fonts.py
#!/usr/bin/env python
# -*- coding: utf8 -*-
import codecs,os,gzip,ctypes,ctypes.util,sys
from struct import *
from PIL import Image, ImageDraw, ImageFont
# ====== Python script to convert TrueTypeFonts to TWRP's .dat format ======
# This script was originally made by https://github.com/suky for his chinese version of TWRP
# and then translated to English by feilplane at #twrp of irc.freenode.net.
# However, it was not compatible with vanilla TWRP, so https://github.com/Tasssadar rewrote
@Tasssadar
Tasssadar / pw_touch_events.c
Created Jul 16, 2014
Small program for kindle paperwhite 2 which tracks touch events and shows battery percentage on screen when the user double taps on the bottom of the screen.
View pw_touch_events.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/input.h>
#include <string.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/poll.h>
@Tasssadar
Tasssadar / make_fork.diff
Last active Aug 29, 2015
Force make to stop just after parsing all makefiles and wait for SIGUSR1, then fork and continue in build. Eliminates parsing of makefiles on each build, thus saves a fuckton of time if you're building something in Android tree over and over.
View make_fork.diff
diff --git a/main.c b/main.c
index f60e6be..bef5652 100644
--- a/main.c
+++ b/main.c
@@ -302,6 +302,18 @@ struct variable shell_var;
char cmd_prefix = '\t';
+/* For the -F/--fork-hack option */
+#define FORK_HACK_PID_FILE ".make-fork-hack.pid"
@Tasssadar
Tasssadar / shinies.md
Last active Aug 29, 2015
random shinies
View shinies.md

Turn off grayscale icons when the window is minimized in plasma 5:

/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml

PlasmaCore.IconItem {
    id: icon

    anchors.fill: parent

visible: false

View gist:439050
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index d44df94..8dbb3c7 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3578,6 +3578,9 @@ void Spell::SendChannelStart(uint32 duration)
}
}
+ //Apply haste rating
+ duration = ApplyHasteToChannelSpell(duration, m_spellInfo, this);
View gist:503920
/*########
## npc_arei
########*/
#define QUEST_ANCIENT_SPIRIT 4261
#define C_TOXIC_HORROR 7132
#define C_IRONTREE_STOMPER 7139
#define S_AREI_TRANSFORM 14888
View gist:503924
/* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
View gist:519116
[Parser(Opcode.SMSG_UPDATE_LFG_LIST)]
public static void HandleUpdateLfgList(Packet packet)
{
var type = (LfgType)packet.ReadInt32();
Console.WriteLine("LFG Type: " + type);
var id = packet.ReadInt32();
Console.WriteLine("Dungeon ID: " + id);
var unkBool = packet.ReadBoolean();