Skip to content

Instantly share code, notes, and snippets.

@CherryDT
CherryDT / providers_settings_parser.py
Created April 15, 2024 16:12
Android Backup settings data file parser
'''
(c) Yogesh Khatri 2019
Updated by David Trapp 2024
License: MIT
Purpose: Read 'com.android.providers.settings.data' located at
<Backup.adb>/apps/com.android.providers.settings/k
Requires: Python 3 and construct
@CherryDT
CherryDT / recordit_download.py
Created March 25, 2024 18:41
Python script to download own RecordIt recordings
# This Python script downloads all the recordings you made with RecordIt as MP4 and GIF files into the current directory.
import requests
from bs4 import BeautifulSoup
import re
import os
import sys
import glob
import xml.etree.ElementTree as ET
@CherryDT
CherryDT / drawTextHook.md
Last active August 17, 2022 19:25
Text-drawing hook for DynRPG

Text-drawing hook for DynRPG

by David "Cherry" Trapp

With the following code, we can add a hook that is called whenever text is drawn to the screen. We can then augment or replace the things that are drawn.

Important: This will only work for a single plugin in the game. If another plugin tries to use the same code below, only the last plugin that gets initialized will actually get its hook called.

Prerequisites

@CherryDT
CherryDT / fb_modules.md
Last active February 13, 2022 00:16
Using modules in FreeBasic

How compilation works

You are probably used to compiling your main.bas file with fbc main.bas, creating a file main.exe. This is an oversimplified view however. Let's see what the docs have to say about that:

At its simplest, fbc takes a source file as a command-line argument and produces an executable file. It does this by compiling the source file (.bas) into an assembly (.asm) file, then compiling this into an object file (.o) using GAS and finally linking using LD this object file to other object files and libraries it needs to run, producing the final executable file. The assembly and compiled object files are deleted at this point by default.

So, actually, this is a multistep process:

  1. main.bas is turned into a generated assembly code file main.asm (or with -gen gcc it would be a generated C code file main.c). We can execute that step alone using fbc -r main.bas.
  2. main.asm is compiled (using GAS, the assembler) to an object
@CherryDT
CherryDT / XEvasionAgiDecouple.cpp
Created December 3, 2021 16:03
Source code of XEvasionAgiDecouple DynRPG plugin
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#include <DynRPG/DynRPG.h>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <wincon.h>
#include <stdlib.h>
#include <stdint.h>
#include <windows.h>
@CherryDT
CherryDT / GodDrinksJava.java
Created March 10, 2021 00:52 — forked from hibiyasleep/GodDrinksJava.java
world.execute(me);
package goddrinksjava;
/**
* The program GodDrinksJava implements an application that
* creates an empty simulated world with no meaning or purpose.
*
* @author momocashew
* @lyrics hibiyasleep
*/
@CherryDT
CherryDT / processes.json
Created April 15, 2020 14:13
PM2 example app list
{
"apps": [
{
"name": "test-app",
"script": "npm",
"args": "start",
"cwd": "/home/ubuntu/app/test-app",
"env": {
"PORT": 3000
},
@CherryDT
CherryDT / Main.elm
Last active March 29, 2020 21:24
Example how to make an Elm program break from the outside
-- from https://elm-lang.org/examples/text-fields
-- modified to include an additional counter
-- the counter will count up on any change of the text OR when clicking the button
import Browser
import Html exposing (Html, Attribute, div, input, button, text)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput, onClick)
@CherryDT
CherryDT / evernote_code_wrap.ahk
Last active August 6, 2020 13:09
Evernote clipboard code wrapper tool
; AutoHotkey script to wrap plain text clipboard contents for Evernote in such a way that they can be pasted as code
; block and won't get double empty lines, removed indents or anything like that.
; By David Trapp
; License: MIT
; WinClip is required, from here: https://autohotkey.com/board/topic/74670-class-winclip-direct-clipboard-manipulations/
#include %A_ScriptDir%\WinClipAPI.ahk
#include %A_ScriptDir%\WinClip.ahk

Keybase proof

I hereby claim:

  • I am CherryDT on github.
  • I am cherrydt (https://keybase.io/cherrydt) on keybase.
  • I have a public key whose fingerprint is FB79 7714 6ABB F3A7 1858 A212 5EA0 2C6B 611B 3FC3

To claim this, I am signing this object: