Skip to content

Instantly share code, notes, and snippets.

View amartinz's full-sized avatar

Alexander Martinz amartinz

View GitHub Profile
@amartinz
amartinz / UELagAction.cpp
Last active November 26, 2023 10:21
Unreal Engine - Toggle "Lag" Action
/*
* Call to toggle lag settings, eg via binding input actions.
* Useful for testing client side prediction, server reconciliation, server side rewind, ...
*
* 1) If lag and loss settings are set, reset
* 2) If lag setting is set, set loss setting
* 3) Else set lag setting
*/
void ToggleLag()
{
#!/bin/bash
# Fetches a patch from a given url and tries to apply it to the current directory
# If GitHub commit links get copy pasted as url, it will append ".patch", else it
# will take the URL as-is.
# Main motivation behind this: i hate to add many different remotes and when i pick
# from GitHub or CAF, it should be fast and hassle free.
#set -x
package at.amartinz.platformtest
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
@amartinz
amartinz / bash_format.bash
Created April 27, 2016 08:46
Terminal formatting with git support
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
# file included below, i would use absolute paths, like
# source /opt/config/git-prompt.bash
source git-prompt.bash
set_prompt () {
Last_Command=$? # Must come first!
Blue='\[\e[01;34m\]'
private void rotateView(View v) {
if (v == null) {
return;
}
v.clearAnimation();
ObjectAnimator animator = ObjectAnimator.ofFloat(v, "rotation", 0.0f, 360.0f);
animator.setDuration(500);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.start();
#!/usr/bin/perl
######################################################################
#
# File : split_bootimg.pl
# Author(s) : William Enck <enck@cse.psu.edu>
# Description : Split appart an Android boot image created
# with mkbootimg. The format can be found in
# android-src/system/core/mkbootimg/bootimg.h
#
# Thanks to alansj on xda-developers.com for